From 62a0357577d6e8dec931ef3c3cc9907cd27be479 Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Thu, 27 Nov 2014 13:20:00 +0100 Subject: [PATCH] on 404, only redirect to front page if this is a user stream --- actions/qvitter.php | 2 +- js/ajax-functions.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/actions/qvitter.php b/actions/qvitter.php index a3a408f..9f5224f 100644 --- a/actions/qvitter.php +++ b/actions/qvitter.php @@ -717,7 +717,7 @@ class QvitterAction extends ApiAction - + diff --git a/js/ajax-functions.js b/js/ajax-functions.js index 81c7d5d..ae47210 100644 --- a/js/ajax-functions.js +++ b/js/ajax-functions.js @@ -93,11 +93,14 @@ function getFromAPI(stream, actionOnSuccess) { type: "GET", dataType: 'json', statusCode: { - 400:function() { + 401:function() { location.reload(); // we may have been logged out in another tab, reload page }, 404:function() { - window.location.replace(window.siteInstanceURL); // redirect to frontpage, probably when trying to access non-existing users + // redirect to frontpage when trying to access non-existing users + if(stream.indexOf('statuses/user_timeline.json?screen_name=') > -1) { + window.location.replace(window.siteInstanceURL); + } } }, success: function(data) {