From c1afc988cb25f27366d24527fb70e718b42fff76 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 19 Aug 2015 17:41:33 -0700 Subject: Added cache: false to ajax calls that caused problems with ie10 --- web/react/utils/client.jsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index 103292abf..c947ff075 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -282,6 +282,7 @@ module.exports.getMeSynchronous = function(success, error) { var currentUser = null; $.ajax({ async: false, + cache: false, url: '/api/v1/users/me', dataType: 'json', contentType: 'application/json', @@ -293,12 +294,9 @@ module.exports.getMeSynchronous = function(success, error) { } }, error: function onError(xhr, status, err) { - var ieChecker = window.navigator.userAgent; // This and the condition below is used to check specifically for browsers IE10 & 11 to suppress a 200 'OK' error from appearing on login - if (xhr.status !== 200 || !(ieChecker.indexOf('Trident/7.0') > 0 || ieChecker.indexOf('Trident/6.0') > 0)) { - if (error) { - var e = handleError('getMeSynchronous', xhr, status, err); - error(e); - } + if (error) { + var e = handleError('getMeSynchronous', xhr, status, err); + error(e); } } }); -- cgit v1.2.3-1-g7c22 From d62924815127c5b7535a8958e2f0ee370aaf21ee Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Thu, 20 Aug 2015 20:34:16 -0700 Subject: Fixed issue with logout in active sessions not working in ie10 --- web/react/utils/client.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index c947ff075..cf828c46e 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -252,6 +252,7 @@ module.exports.revokeSession = function(altId, success, error) { module.exports.getSessions = function(userId, success, error) { $.ajax({ + cache: false, url: '/api/v1/users/' + userId + '/sessions', dataType: 'json', contentType: 'application/json', @@ -789,6 +790,7 @@ module.exports.removeChannelMember = function(id, data, success, error) { module.exports.getProfiles = function(success, error) { $.ajax({ + cache: false, url: '/api/v1/users/profiles', dataType: 'json', contentType: 'application/json', -- cgit v1.2.3-1-g7c22 From 86428fff9950cd3d08601d179d3953c3936ccabf Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Sat, 22 Aug 2015 11:59:42 -0700 Subject: Fixes issue with profile pictures not updating w/o refresh and prevents more ie10 ajax caching issues --- web/react/components/post.jsx | 2 +- web/react/utils/client.jsx | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web/react/components/post.jsx b/web/react/components/post.jsx index 7bc6a8c01..53ffeb400 100644 --- a/web/react/components/post.jsx +++ b/web/react/components/post.jsx @@ -102,7 +102,7 @@ module.exports = React.createClass({ currentUserCss = "current--user"; } - var timestamp = UserStore.getCurrentUser().update_at; + var timestamp = UserStore.getProfile(post.user_id).update_at; return (
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index cf828c46e..754843697 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -565,6 +565,7 @@ module.exports.updateLastViewedAt = function(channelId, success, error) { function getChannels(success, error) { $.ajax({ + cache: false, url: '/api/v1/channels/', dataType: 'json', type: 'GET', @@ -580,6 +581,7 @@ module.exports.getChannels = getChannels; module.exports.getChannel = function(id, success, error) { $.ajax({ + cache: false, url: '/api/v1/channels/' + id + '/', dataType: 'json', type: 'GET', @@ -609,6 +611,7 @@ module.exports.getMoreChannels = function(success, error) { function getChannelCounts(success, error) { $.ajax({ + cache: false, url: '/api/v1/channels/counts', dataType: 'json', type: 'GET', @@ -652,6 +655,7 @@ module.exports.executeCommand = function(channelId, command, suggest, success, e module.exports.getPosts = function(channelId, offset, limit, success, error, complete) { $.ajax({ + cache: false, url: '/api/v1/channels/' + channelId + '/posts/' + offset + '/' + limit, dataType: 'json', type: 'GET', @@ -667,6 +671,7 @@ module.exports.getPosts = function(channelId, offset, limit, success, error, com module.exports.getPost = function(channelId, postId, success, error) { $.ajax({ + cache: false, url: '/api/v1/channels/' + channelId + '/post/' + postId, dataType: 'json', type: 'GET', -- cgit v1.2.3-1-g7c22