Skip to content

Commit

Permalink
Fix AddressManager previous search data load logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaewoook committed Aug 14, 2022
1 parent 602e32a commit 9ebfe45
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/AddressManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}
}

Expand Down

0 comments on commit 9ebfe45

Please sign in to comment.