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

Commit 24022b6

Browse files
authored
Merge pull request #1827 from OpenBazaar/fixBlankListingRoute
Makes sure a userPage/listing route can't be set without an item hash…
2 parents c5841b6 + 0dcc6d7 commit 24022b6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

js/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ module.exports = Backbone.Router.extend({
375375
userModel: this.userModel,
376376
userProfile: this.userProfile,
377377
userID: userID,
378-
state: state,
378+
state: state === 'listing' && !itemHash ? 'store' : state,
379379
itemHash: itemHash,
380380
socketView: this.socketView,
381381
skipNSFWmodal: skipNSFWmodal

js/views/userPageVw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ UserPageVw = pageVw.extend({
499499

500500
options = options || {};
501501

502-
if (state === "listing"){
502+
if (state === "listing" && hash){
503503
//clear old templates
504504
this.$el.find('.js-list4').html("");
505505
this.tabClick(this.$el.find('.js-storeTab'), this.$el.find('.js-item'));
@@ -534,7 +534,7 @@ UserPageVw = pageVw.extend({
534534
}
535535
this.tabClick(this.$el.find(".js-" + state + "Tab"), this.$el.find(".js-" + state));
536536
this.addTabToHistory(state, options.replaceHistory);
537-
} else if (state){
537+
} else if (state && state !== 'listing'){
538538
this.tabClick(this.$el.find(".js-" + state + "Tab"), this.$el.find(".js-" + state));
539539
} else {
540540
//if no state was set

0 commit comments

Comments
 (0)