garrensmith commented on a change in pull request #1120: Use relative pathname
instead of static pathname for local replication
URL: https://github.com/apache/couchdb-fauxton/pull/1120#discussion_r208109405
##########
File path: app/addons/replication/components/common-table.js
##########
@@ -16,22 +16,35 @@ import {Table, Tooltip, OverlayTrigger} from
"react-bootstrap";
import moment from 'moment';
import {ErrorModal} from './modals';
import {removeCredentialsFromUrl} from '../api';
+import Helpers from '../../../helpers';
+
+const getDbNameFromUrl = (urlObj, root) => {
+ let encoded;
+ try {
+ const urlWithoutDb = new URL(root);
+ const dbName = urlObj.pathname.substring(urlWithoutDb.pathname.length);
+ encoded = encodeURIComponent(dbName);
Review comment:
just return at this point. No need for the `encoded` variable
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services