[Gekidou MM-45506] Do not include empty DM and GMs in Channel List (#6630)

This commit is contained in:
Jason Frerich
2022-09-14 08:36:15 -05:00
committed by GitHub
parent 36846e9b4c
commit 9b41b21319
2 changed files with 21 additions and 4 deletions

View File

@@ -436,6 +436,16 @@ export const queryMyChannelUnreads = (database: Database, currentTeamId: string)
);
};
export const queryEmptyDirectAndGroupChannels = (database: Database) => {
return database.get<MyChannelModel>(MY_CHANNEL).query(
Q.on(
CHANNEL,
Q.where('team_id', Q.eq('')),
),
Q.where('last_post_at', Q.eq(0)),
);
};
export function observeMyChannelMentionCount(database: Database, teamId?: string, columns = ['mentions_count', 'is_unread']): Observable<number> {
const conditions: Q.Condition[] = [
Q.where('delete_at', Q.eq(0)),