FIX: back button behaviour should be consistent when visiting watched/muted topics from user preferences page

This commit is contained in:
Arpit Jalan 2016-10-13 00:59:06 +05:30
parent 095170d6df
commit a0e0ab610e
1 changed files with 9 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import Group from 'discourse/models/group';
import Topic from 'discourse/models/topic'; import Topic from 'discourse/models/topic';
import { emojiUnescape } from 'discourse/lib/text'; import { emojiUnescape } from 'discourse/lib/text';
import PreloadStore from 'preload-store'; import PreloadStore from 'preload-store';
import { defaultHomepage } from 'discourse/lib/utilities';
const User = RestModel.extend({ const User = RestModel.extend({
@ -135,9 +136,15 @@ const User = RestModel.extend({
adminPath: url('id', 'username_lower', "/admin/users/%@1/%@2"), adminPath: url('id', 'username_lower', "/admin/users/%@1/%@2"),
mutedTopicsPath: url('/latest?state=muted'), @computed()
mutedTopicsPath() {
return defaultHomepage() === "latest" ? Discourse.getURL('/?state=muted') : Discourse.getURL('/latest?state=muted');
},
watchingTopicsPath: url('/latest?state=watching'), @computed()
watchingTopicsPath() {
return defaultHomepage() === "latest" ? Discourse.getURL('/?state=watching') : Discourse.getURL('/latest?state=watching');
},
@computed("username") @computed("username")
username_lower(username) { username_lower(username) {