Show the current channel when category is collapsed on tablets (#6888)

This commit is contained in:
Elias Nahum
2022-12-21 20:42:45 +02:00
committed by GitHub
parent bcb8ffa2d1
commit 9da7b47827
2 changed files with 7 additions and 3 deletions

View File

@@ -404,7 +404,13 @@ export async function setCurrentTeamAndChannelId(operator: ServerDataOperator, t
export const observeLastUnreadChannelId = (database: Database): Observable<string> => {
return querySystemValue(database, SYSTEM_IDENTIFIERS.LAST_UNREAD_CHANNEL_ID).observe().pipe(
switchMap((result) => (result.length ? result[0].observe() : of$({value: ''}))),
switchMap((model) => of$(model.value)),
switchMap((model) => {
if (model.value) {
return of$(model.value);
}
return observeCurrentChannelId(database);
}),
);
};

View File

@@ -162,8 +162,6 @@ const enhance = withObservables(['category', 'isTablet', 'locale'], ({category,
return {
limit,
sortedChannels,
notifyProps,
lastUnreadId,
unreadsOnTop,
unreadIds,
category,