From d38a0042babf94e3812587ed8282786f88108a9a Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Mon, 7 Jun 2021 18:17:44 -0400 Subject: [PATCH] Fix new link scenario where default color is not set --- ts/background.ts | 14 ++++++++------ ts/test-both/state/selectors/conversations_test.ts | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ts/background.ts b/ts/background.ts index 82bb743de54f..a8ba1848fa4a 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -81,6 +81,14 @@ export async function startApp(): Promise { 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(resolve => { resolveOnAppView = resolve; @@ -414,12 +422,6 @@ export async function startApp(): Promise { } 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; diff --git a/ts/test-both/state/selectors/conversations_test.ts b/ts/test-both/state/selectors/conversations_test.ts index 1ab24c5fc911..548fc00f736a 100644 --- a/ts/test-both/state/selectors/conversations_test.ts +++ b/ts/test-both/state/selectors/conversations_test.ts @@ -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'); }); }); });