Do not populate left pane on initial link

This commit is contained in:
Josh Perez 2021-04-20 16:16:49 -07:00 committed by GitHub
parent f456bbd3db
commit 5e2d48cc2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 791 additions and 277 deletions

View file

@ -0,0 +1,32 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { onTimeout } from '../services/timers';
class PostLinkExperience {
private hasNotFinishedSync: boolean;
constructor() {
this.hasNotFinishedSync = false;
}
start() {
this.hasNotFinishedSync = true;
// timeout "post link" after 10 minutes in case the syncs don't complete
// in time or are never called.
onTimeout(Date.now() + 60 * 60 * 10 * 1000, () => {
this.stop();
});
}
stop() {
this.hasNotFinishedSync = false;
}
isActive(): boolean {
return this.hasNotFinishedSync === true;
}
}
export const postLinkExperience = new PostLinkExperience();