From f8f50113da1f97119545bd6afcd87004b8bdb462 Mon Sep 17 00:00:00 2001 From: wes Date: Mon, 28 Aug 2017 18:05:05 -0400 Subject: [PATCH] more bug fixing --- src/scripts/app.tag | 5 +---- src/scripts/browse.tag | 1 + src/scripts/post.tag | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/scripts/app.tag b/src/scripts/app.tag index d18fb9e..29a46f0 100644 --- a/src/scripts/app.tag +++ b/src/scripts/app.tag @@ -201,10 +201,7 @@ to(name) { this.menuOff(e); } console.log("routing to " + name); - if (name == "posts") { - this.route(`${name}/${self.state._id}`); - } - else { + if (name != "posts") { this.route(name); } return; diff --git a/src/scripts/browse.tag b/src/scripts/browse.tag index 5c88033..1311df9 100644 --- a/src/scripts/browse.tag +++ b/src/scripts/browse.tag @@ -55,6 +55,7 @@ self.converter = new showdown.Converter(); self.openPost = (id) => { return ((ev) => { self.route(`/posts/${id}`); + RiotControl.trigger("openpost", id); }); }; diff --git a/src/scripts/post.tag b/src/scripts/post.tag index e9d9721..aaa2d28 100644 --- a/src/scripts/post.tag +++ b/src/scripts/post.tag @@ -117,7 +117,7 @@ updatePost(postcontent) { self.content = postcontent.content; self.title = postcontent.title; - if (self.opts.state._id !== self._id) { + if (window.location.pathname !== `/blog/posts/${self._id}`) { self.route(`/posts/${self._id}`); }