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

Commit b68ccf5

Browse files
committed
More cleanup of logic.
1 parent 4ecab97 commit b68ccf5

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

js/views/userPageVw.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,9 @@ UserPageVw = pageVw.extend({
483483
},
484484

485485
setState: function(state, hash, options) {
486-
var currentGUID = this.model.get('page').profile.guid,
487-
addressState,
486+
var addressState,
488487
currentHandle = this.model.get('page').profile.handle,
489-
currentAddress,
490-
isItemType = false;
488+
currentAddress;
491489

492490
options = options || {};
493491

@@ -544,21 +542,14 @@ UserPageVw = pageVw.extend({
544542
}
545543

546544
if (state == "listing" || state == "listingOld" || state == "listingNew") {
547-
isItemType = true;
548-
}
549-
550-
//set address bar
551-
if (isItemType) {
552545
addressState = "/listing";
546+
addressState = hash ? addressState + "/" + hash : addressState;
553547
} else {
554548
addressState = "/" + state;
555549
}
556550

557-
currentAddress = currentHandle || currentGUID;
551+
currentAddress = currentHandle || this.model.get('page').profile.guid;
558552
currentAddress += addressState;
559-
if (isItemType && hash) {
560-
currentAddress += "/" + hash;
561-
}
562553

563554
window.obEventBus.trigger("setAddressBar", {'addressText': currentAddress});
564555
currentHandle && app.appBar.setTitle(currentHandle);

0 commit comments

Comments
 (0)