Skip to content

Commit

Permalink
Check if there is data in local storage before reloading.
Browse files Browse the repository at this point in the history
Closes #1450.
  • Loading branch information
imolorhe committed Feb 23, 2021
1 parent 1eb73a4 commit 6acc9b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/altair-electron/src/preload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ process.once('loaded', () => {
// console.log(allStorage());
const store = new ElectronStoreAdapter(ipc);
// Check if data is stored in electron store
if (!store.length) {
if (!store.length && window.localStorage.length) {
// Else, copy content of localstorage into electron store and reload.
Object.keys(window.localStorage).forEach(key => {
store.setItem(key, window.localStorage.getItem(key));
Expand Down

0 comments on commit 6acc9b7

Please sign in to comment.