summaryrefslogtreecommitdiffstats
path: root/webapp/actions/global_actions.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-09-05 17:40:35 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-09-05 17:40:35 -0400
commite30e4cfe3d787e2528419b0d17973eb0fc162d56 (patch)
tree8b6e989dccfe7308786167c0767f4699f28841ae /webapp/actions/global_actions.jsx
parent6ca443a2556e5d4bade9a9ef7d6d877bf1d6fc45 (diff)
downloadchat-e30e4cfe3d787e2528419b0d17973eb0fc162d56.tar.gz
chat-e30e4cfe3d787e2528419b0d17973eb0fc162d56.tar.bz2
chat-e30e4cfe3d787e2528419b0d17973eb0fc162d56.zip
PLT-7468 Moved more error pages to use predefined error types (#7378)
* PLT-7468 Moved more errors to use error types * PLT-7468 Moved 404 error page to use error types * Made helper function for rendering external links on error page
Diffstat (limited to 'webapp/actions/global_actions.jsx')
-rw-r--r--webapp/actions/global_actions.jsx16
1 files changed, 2 insertions, 14 deletions
diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx
index 025e56f7d..73a57e0b0 100644
--- a/webapp/actions/global_actions.jsx
+++ b/webapp/actions/global_actions.jsx
@@ -17,8 +17,7 @@ import {stopPeriodicStatusUpdates} from 'actions/status_actions.jsx';
import * as WebsocketActions from 'actions/websocket_actions.jsx';
import {trackEvent} from 'actions/diagnostics_actions.jsx';
-import Constants from 'utils/constants.jsx';
-const ActionTypes = Constants.ActionTypes;
+import {ActionTypes, Constants, ErrorPageTypes} from 'utils/constants.jsx';
import EventTypes from 'utils/event_types.jsx';
import WebSocketClient from 'client/web_websocket_client.jsx';
@@ -146,18 +145,7 @@ export function emitPostFocusEvent(postId, onSuccess) {
}
});
} else {
- let link = `${TeamStore.getCurrentTeamRelativeUrl()}/channels/`;
- const channel = ChannelStore.getCurrent();
- if (channel) {
- link += channel.name;
- } else {
- link += 'town-square';
- }
-
- const message = encodeURIComponent(Utils.localizeMessage('permalink.error.access', 'Permalink belongs to a deleted message or to a channel to which you do not have access.'));
- const title = encodeURIComponent(Utils.localizeMessage('permalink.error.title', 'Message Not Found'));
-
- browserHistory.push('/error?message=' + message + '&title=' + title + '&link=' + encodeURIComponent(link));
+ browserHistory.push('/error?type=' + ErrorPageTypes.PERMALINK_NOT_FOUND);
}
}
);