forked from Ivasoft/mattermost-mobile
Fix team switch when there is no history in the team (#5943)
This commit is contained in:
committed by
GitHub
parent
22564b8182
commit
8cb7dd2fa9
@@ -59,13 +59,15 @@ export const queryNthLastChannelFromTeam = async (database: Database, teamId: st
|
||||
if (teamChannelHistory.channelIds.length > n + 1) {
|
||||
channelId = teamChannelHistory.channelIds[n];
|
||||
}
|
||||
} finally {
|
||||
if (!channelId) {
|
||||
// No channel history for the team
|
||||
const channel = await queryDefaultChannelForTeam(database, teamId);
|
||||
if (channel) {
|
||||
channelId = channel.id;
|
||||
}
|
||||
} catch {
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
if (!channelId) {
|
||||
// No channel history for the team
|
||||
const channel = await queryDefaultChannelForTeam(database, teamId);
|
||||
if (channel) {
|
||||
channelId = channel.id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user