Refactor app initialization logic

This commit is contained in:
trevor-signal
2025-02-12 13:37:30 -05:00
committed by GitHub
parent 205c477082
commit 4c3db76bde
17 changed files with 394 additions and 582 deletions

View File

@@ -1188,7 +1188,13 @@ export default class AccountManager extends EventTarget {
await storage.put('identityKeyMap', identityKeyMap);
await storage.put('registrationIdMap', registrationIdMap);
await ourProfileKeyService.set(profileKey);
const me = window.ConversationController.getOurConversationOrThrow();
await me.setProfileKey(Bytes.toBase64(profileKey), {
reason: 'registration',
});
if (userAgent) {
await storage.put('userAgent', userAgent);
}
@@ -1351,7 +1357,7 @@ export default class AccountManager extends EventTarget {
async #registrationDone(): Promise<void> {
log.info('registration done');
this.dispatchEvent(new Event('registration'));
this.dispatchEvent(new Event('endRegistration'));
}
async setPni(