From 972a4cba0c0a6a06fb3df2421a7781c38206d2ce Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Tue, 22 Jun 2021 07:18:22 -0700 Subject: [PATCH] Show universal timer notification in open conversation --- ts/background.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ts/background.ts b/ts/background.ts index fa407a18fb..e4613a95dd 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -534,11 +534,25 @@ export async function startApp(): Promise { newValue: number | undefined ): Promise => { 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: () => {