Skip to content

Commit

Permalink
Show universal timer notification in open conversation
Browse files Browse the repository at this point in the history
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
  • Loading branch information
automated-signal and indutny-signal committed Jun 22, 2021
1 parent ba54f62 commit 8ea1a91
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ts/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: () => {
Expand Down

0 comments on commit 8ea1a91

Please sign in to comment.