Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 3c4d6a2

Browse files
committed
More efficient way to join the subPath.
1 parent 9d06421 commit 3c4d6a2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

js/router.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,19 +402,17 @@ module.exports = Backbone.Router.extend({
402402
processHandle = this.processHandle(handle).done((guid) => {
403403
var state,
404404
itemHash,
405-
skipNSFWmodal,
406-
subPathString;
405+
skipNSFWmodal;
407406

408407
subPath = subPath && subPath.slice(1).split('/');
409408
state = subPath && subPath[0] || null;
410409
itemHash = subPath && subPath[1] || null;
411410
skipNSFWmodal = subPath && subPath[2] || null;
412-
subPathString = subPath.join('/');
413411

414412
// we want this to happen after the launchPageConnectModal processes
415413
// the resolution of the promise, hence the timeout.
416414
setTimeout(() => {
417-
this.navigate(`userPage/${guid}${subPath ? '/' + subPathString : ''}`, { replace: true });
415+
this.navigate(`userPage/${guid}${subPath ? '/' + subPath.join('/') : ''}`, { replace: true });
418416
this.userPage(guid, state, itemHash, skipNSFWmodal, '@' + handle);
419417
}, 0);
420418
});

0 commit comments

Comments
 (0)