Browse Source

Fixed redirect after posting message.

Rafał Pitoń 10 years ago
parent
commit
65221ccf84
1 changed files with 5 additions and 5 deletions
  1. 5 5
      misago/static/misago/js/misago-posting.js

+ 5 - 5
misago/static/misago/js/misago-posting.js

@@ -273,11 +273,11 @@ $(function() {
               if (on_post) {
                 _this.$ajax_complete.addClass('in')
 
-                if (data.post_url.indexOf(window.location.pathname) != -1) {
-                  window.location.href = data.post_url;
-                  window.location.reload(true)
-                } else {
-                  window.location.href = data.post_url;
+                var past_location = window.location.href;
+                window.location.href = data.post_url;
+
+                if (past_location.indexOf(window.location.href)) {
+                  window.reload();
                 }
               }
             } else if (data.errors !== undefined) {