diff --git a/app/components/sidebars/main/main_sidebar.js b/app/components/sidebars/main/main_sidebar.js index fbbfb12ec..95182077b 100644 --- a/app/components/sidebars/main/main_sidebar.js +++ b/app/components/sidebars/main/main_sidebar.js @@ -178,6 +178,20 @@ export default class ChannelSidebar extends Component { this.closeChannelDrawer(); + if (!channel) { + const utils = require('app/utils/general'); + const {intl} = this.context; + + const unableToJoinMessage = { + id: 'mobile.open_unknown_channel.error', + defaultMessage: "We couldn't join the channel. Please reset the cache and try again.", + }; + const erroMessage = {}; + + utils.alertErrorWithFallback(intl, erroMessage, unableToJoinMessage); + return; + } + setChannelLoading(channel.id !== currentChannelId); setChannelDisplayName(channel.display_name); EventEmitter.emit('switch_channel', channel, currentChannelId); diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index 06201695f..b5245db94 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -2527,6 +2527,7 @@ "mobile.offlineIndicator.offline": "Cannot connect to the server", "mobile.open_dm.error": "We couldn't open a direct message with {displayName}. Please check your connection and try again.", "mobile.open_gm.error": "We couldn't open a group message with those users. Please check your connection and try again.", + "mobile.open_unknown_channel.error": "Unable to join the channel. Please reset the cache and try again.", "mobile.post.cancel": "Cancel", "mobile.post.delete_question": "Are you sure you want to delete this post?", "mobile.post.delete_title": "Delete Post",