diff options
Diffstat (limited to 'webapp/stores')
-rw-r--r-- | webapp/stores/admin_store.jsx | 6 | ||||
-rw-r--r-- | webapp/stores/browser_store.jsx | 5 | ||||
-rw-r--r-- | webapp/stores/channel_store.jsx | 2 | ||||
-rw-r--r-- | webapp/stores/error_store.jsx | 10 | ||||
-rw-r--r-- | webapp/stores/post_store.jsx | 5 | ||||
-rw-r--r-- | webapp/stores/team_store.jsx | 5 |
6 files changed, 28 insertions, 5 deletions
diff --git a/webapp/stores/admin_store.jsx b/webapp/stores/admin_store.jsx index ecfbaf85f..b135d9485 100644 --- a/webapp/stores/admin_store.jsx +++ b/webapp/stores/admin_store.jsx @@ -22,7 +22,7 @@ class AdminStoreClass extends EventEmitter { this.logs = null; this.audits = null; this.config = null; - this.teams = null; + this.teams = {}; this.complianceReports = null; } @@ -126,6 +126,10 @@ class AdminStoreClass extends EventEmitter { this.teams = teams; } + getTeam(id) { + return this.teams[id]; + } + getSelectedTeams() { const result = BrowserStore.getItem('seleted_teams'); if (!result) { diff --git a/webapp/stores/browser_store.jsx b/webapp/stores/browser_store.jsx index 2dae78f46..11fe50928 100644 --- a/webapp/stores/browser_store.jsx +++ b/webapp/stores/browser_store.jsx @@ -158,6 +158,7 @@ class BrowserStoreClass { clear() { // don't clear the logout id so IE11 can tell which tab sent a logout request const logoutId = sessionStorage.getItem('__logout__'); + const serverVersion = this.getLastServerVersion(); sessionStorage.clear(); localStorage.clear(); @@ -165,6 +166,10 @@ class BrowserStoreClass { if (logoutId) { sessionStorage.setItem('__logout__', logoutId); } + + if (serverVersion) { + this.setLastServerVersion(serverVersion); + } } clearAll() { diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx index 32ea8441c..b34e92530 100644 --- a/webapp/stores/channel_store.jsx +++ b/webapp/stores/channel_store.jsx @@ -290,7 +290,7 @@ class ChannelStoreClass extends EventEmitter { } leaveChannel(id) { - delete this.channelMembers[id]; + Reflect.deleteProperty(this.channelMembers, id); const element = this.channels.indexOf(id); if (element > -1) { this.channels.splice(element, 1); diff --git a/webapp/stores/error_store.jsx b/webapp/stores/error_store.jsx index 278e252c0..4a357472d 100644 --- a/webapp/stores/error_store.jsx +++ b/webapp/stores/error_store.jsx @@ -64,8 +64,10 @@ class ErrorStoreClass extends EventEmitter { clearLastError() { var lastError = this.getLastError(); + + // preview message can only be cleared by clearPreviewError if (lastError && lastError.email_preview) { - this.ignore_email_preview = true; + return; } BrowserStore.removeGlobalItem('last_error'); @@ -74,6 +76,12 @@ class ErrorStoreClass extends EventEmitter { this.emitChange(); } } + + clearPreviewError() { + this.ignore_email_preview = true; + this.storeLastError(''); + this.clearLastError(); + } } var ErrorStore = new ErrorStoreClass(); diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx index 17529acb6..7a532fa2e 100644 --- a/webapp/stores/post_store.jsx +++ b/webapp/stores/post_store.jsx @@ -454,10 +454,11 @@ class PostStoreClass extends EventEmitter { for (let i = 0; i < len; i++) { const post = postList.posts[postList.order[i]]; - // don't edit webhook posts or deleted posts + // don't edit webhook posts, deleted posts, or system messages if (post.user_id !== userId || (post.props && post.props.from_webhook) || - post.state === Constants.POST_DELETED) { + post.state === Constants.POST_DELETED || + (post.type && post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX))) { continue; } diff --git a/webapp/stores/team_store.jsx b/webapp/stores/team_store.jsx index 8eebbaca5..210d5c211 100644 --- a/webapp/stores/team_store.jsx +++ b/webapp/stores/team_store.jsx @@ -177,6 +177,11 @@ TeamStore.dispatchToken = AppDispatcher.register((payload) => { TeamStore.saveMyTeam(action.team); TeamStore.emitChange(); break; + case ActionTypes.CREATED_TEAM: + TeamStore.saveTeam(action.team); + TeamStore.appendTeamMember(action.member); + TeamStore.emitChange(); + break; case ActionTypes.RECEIVED_ALL_TEAMS: TeamStore.saveTeams(action.teams); TeamStore.emitChange(); |