Skip to content

Commit

Permalink
1.refine localstorage instance
Browse files Browse the repository at this point in the history
  • Loading branch information
cwangsmv committed Jan 15, 2025
1 parent 99a0ae3 commit d0f5b17
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/insomnia/src/main/window-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface Bounds {
}

export function init() {
localStorage = initLocalStorage();
initLocalStorage();
}
const stopAndWaitForHiddenBrowserWindow = async (runningHiddenBrowserWindow: BrowserWindow) => {
return await new Promise<void>(resolve => {
Expand Down Expand Up @@ -802,7 +802,9 @@ export const setZoom = (transformer: (current: number) => number) => () => {

export function initLocalStorage() {
const localStoragePath = path.join(process.env['INSOMNIA_DATA_PATH'] || app.getPath('userData'), 'localStorage');
const localStorage = new LocalStorage(localStoragePath);
if (!localStorage) {
localStorage = new LocalStorage(localStoragePath);
}
return localStorage;
}

Expand Down

0 comments on commit d0f5b17

Please sign in to comment.