Expiration timer shouldn't count as unread on link

This commit is contained in:
Fedor Indutny 2022-05-25 13:48:23 -07:00 committed by GitHub
parent 7138daf5ef
commit 83b3ae9387
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 7 deletions

View file

@ -1891,6 +1891,10 @@ export async function startApp(): Promise<void> {
}
}
// When true - we are running the very first storage and contact sync after
// linking.
let isInitialSync = false;
let connectCount = 0;
let connecting = false;
async function connect(firstRun?: boolean) {
@ -1904,6 +1908,9 @@ export async function startApp(): Promise<void> {
try {
connecting = true;
// Reset the flag and update it below if needed
isInitialSync = false;
log.info('connect', { firstRun, connectCount });
if (reconnectTimer) {
@ -2145,6 +2152,7 @@ export async function startApp(): Promise<void> {
const contactSyncComplete = waitForEvent('contactSync:complete');
log.info('firstRun: requesting initial sync');
isInitialSync = true;
// Request configuration, block, GV1 sync messages, contacts
// (only avatars and inboxPosition),and Storage Service sync.
@ -2176,6 +2184,9 @@ export async function startApp(): Promise<void> {
);
}
log.info('firstRun: initial sync complete');
isInitialSync = false;
// Switch to inbox view even if contact sync is still running
if (
window.reduxStore.getState().app.appView === AppViewType.Installer
@ -2641,6 +2652,7 @@ export async function startApp(): Promise<void> {
undefined,
{
fromSync: true,
isInitialSync,
}
);
}