Move common utils out of conversation view

This commit is contained in:
Josh Perez
2021-09-27 12:29:00 -04:00
committed by GitHub
parent 9791fa43ef
commit 9888e6d38f
4 changed files with 46 additions and 38 deletions
+18
View File
@@ -0,0 +1,18 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ConversationModel } from '../models/conversations';
export async function markAllAsVerifiedDefault(
unverified: ReadonlyArray<ConversationModel>
): Promise<void> {
await Promise.all(
unverified.map(contact => {
if (contact.isUnverified()) {
return contact.setVerifiedDefault();
}
return null;
})
);
}