Fix new link scenario where default color is not set

This commit is contained in:
Josh Perez 2021-06-07 18:17:44 -04:00 committed by GitHub
parent 906b949c47
commit d38a0042ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View file

@ -81,6 +81,14 @@ export async function startApp(): Promise<void> {
ourProfileKeyService.initialize(window.storage);
window.storage.onready(() => {
if (!window.storage.get('defaultConversationColor')) {
window.storage.put('defaultConversationColor', {
color: 'ultramarine',
});
}
});
let resolveOnAppView: (() => void) | undefined;
const onAppView = new Promise<void>(resolve => {
resolveOnAppView = resolve;
@ -414,12 +422,6 @@ export async function startApp(): Promise<void> {
}
first = false;
if (!window.storage.get('defaultConversationColor')) {
window.storage.put('defaultConversationColor', {
color: 'ultramarine',
});
}
cleanupSessionResets();
const retryPlaceholders = new window.Signal.Util.RetryPlaceholders();
window.Signal.Services.retryPlaceholders = retryPlaceholders;

View file

@ -1865,9 +1865,9 @@ describe('both/state/selectors/conversations', () => {
assert.equal(contactNameColorSelector('group', 'jih'), '120');
assert.equal(contactNameColorSelector('group', 'mlk'), '300');
assert.equal(contactNameColorSelector('group', 'pon'), '010');
assert.equal(contactNameColorSelector('group', 'srq'), '330');
assert.equal(contactNameColorSelector('group', 'vut'), '230');
assert.equal(contactNameColorSelector('group', 'zyx'), '180');
assert.equal(contactNameColorSelector('group', 'srq'), '210');
assert.equal(contactNameColorSelector('group', 'vut'), '330');
assert.equal(contactNameColorSelector('group', 'zyx'), '230');
});
});
});