Generalize keepMutedChatsArchived check

This commit is contained in:
Fedor Indutny 2023-02-06 10:08:53 -08:00 committed by GitHub
parent f3b68677b3
commit dff924c0c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 7 deletions

View file

@ -0,0 +1,23 @@
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ConversationAttributesType } from '../model-types.d';
import { isConversationMuted } from './isConversationMuted';
export function canConversationBeUnarchived(
attrs: ConversationAttributesType
): boolean {
if (!attrs.isArchived) {
return false;
}
if (!isConversationMuted(attrs)) {
return true;
}
if (window.storage.get('keepMutedChatsArchived') ?? false) {
return false;
}
return true;
}