Show universal timer notification in open conversation

This commit is contained in:
Fedor Indutny 2021-06-22 07:18:22 -07:00 committed by GitHub
parent 672d060172
commit 972a4cba0c
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: () => {