Show universal timer notification in open conversation

Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
automated-signal 2021-06-22 07:47:58 -07:00 committed by GitHub
parent ba54f629c3
commit 8ea1a91616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -534,11 +534,25 @@ export async function startApp(): Promise<void> {
newValue: number | undefined
): Promise<void> => {
await universalExpireTimer.set(newValue);
// Update account in Storage Service
const conversationId = window.ConversationController.getOurConversationIdOrThrow();
const account = window.ConversationController.get(conversationId);
assert(account, "Account wasn't found");
account.captureChange('universalExpireTimer');
// Add a notification to the currently open conversation
const state = window.reduxStore.getState();
const selectedId = state.conversations.selectedConversationId;
if (selectedId) {
const conversation = window.ConversationController.get(selectedId);
assert(conversation, "Conversation wasn't found");
conversation.queueJob('maybeSetPendingUniversalTimer', () =>
conversation.maybeSetPendingUniversalTimer()
);
}
},
addDarkOverlay: () => {