From 9ebfe459ecd38c8f4ca26257ffc1909c857761d0 Mon Sep 17 00:00:00 2001 From: Jaewook Ahn Date: Sun, 14 Aug 2022 20:54:12 +0900 Subject: [PATCH] Fix AddressManager previous search data load logic --- src/AddressManager.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/AddressManager.ts b/src/AddressManager.ts index fdf9853..05f43e1 100644 --- a/src/AddressManager.ts +++ b/src/AddressManager.ts @@ -46,13 +46,14 @@ export class AddressManager { this.settingsManager = settingsManager; if (this.settingsManager && isExtension()) { - const settings = this.settingsManager?.settings; - if (!settings) { - console.warn("AddressManager", "No settings found!"); - return; - } - this.addressData = settings.addressData || []; - this.previousSearchKey = settings.prevSearchKey || DEFAULT_SETTINGS.prevSearchKey as SearchKey; + this.settingsManager.loadSettings().then((settings) => { + if (!settings) { + console.warn("AddressManager", "No settings found!"); + return; + } + this.addressData = settings.addressData || []; + this.previousSearchKey = settings.prevSearchKey || DEFAULT_SETTINGS.prevSearchKey as SearchKey; + }); } }