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

Commit

Permalink
Merge pull request #1827 from OpenBazaar/fixBlankListingRoute
Browse files Browse the repository at this point in the history
Makes sure a userPage/listing route can't be set without an item hash…
  • Loading branch information
rmisio authored Nov 3, 2016
2 parents c5841b6 + 0dcc6d7 commit 24022b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ module.exports = Backbone.Router.extend({
userModel: this.userModel,
userProfile: this.userProfile,
userID: userID,
state: state,
state: state === 'listing' && !itemHash ? 'store' : state,
itemHash: itemHash,
socketView: this.socketView,
skipNSFWmodal: skipNSFWmodal
Expand Down
4 changes: 2 additions & 2 deletions js/views/userPageVw.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ UserPageVw = pageVw.extend({

options = options || {};

if (state === "listing"){
if (state === "listing" && hash){
//clear old templates
this.$el.find('.js-list4').html("");
this.tabClick(this.$el.find('.js-storeTab'), this.$el.find('.js-item'));
Expand Down Expand Up @@ -534,7 +534,7 @@ UserPageVw = pageVw.extend({
}
this.tabClick(this.$el.find(".js-" + state + "Tab"), this.$el.find(".js-" + state));
this.addTabToHistory(state, options.replaceHistory);
} else if (state){
} else if (state && state !== 'listing'){
this.tabClick(this.$el.find(".js-" + state + "Tab"), this.$el.find(".js-" + state));
} else {
//if no state was set
Expand Down

0 comments on commit 24022b6

Please sign in to comment.