Skip to content

Node.js based forum software built for the modern web

closes #2148

psychobunnyc692f7e8fe88
diff --git a/public/src/forum/chats.js b/public/src/forum/chats.js
index 84bf4fd4cc..aa1af729b3 100644
--- a/public/src/forum/chats.js
+++ b/public/src/forum/chats.js
@@ -66,9 +66,14 @@ define('forum/chats', ['string', 'sounds', 'forum/infinitescroll'], function(S,
popoutEl.on('click', function() {
var username = $('.expanded-chat').attr('data-username'),
uid = Chats.getRecipientUid();
- ajaxify.go('chats', function() {
- app.openChat(username, uid);
- }, true);
+
+ if (app.previousUrl && app.previousUrl.match(/chats/)) {
+ ajaxify.go('chats', function() {
+ app.openChat(username, uid);
+ }, true);
+ } else {
+ window.history.go(-1);
+ }
});
$('.recent-chats').on('scroll', function() {