Skip to content

Commit 97e564d

Browse files
committed
update store with migrations to change OATimeserie to Hydrograph
1 parent 42b3b91 commit 97e564d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

electron/main.cjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ async function createWindow () {
4141
await import('electron-store')
4242
.then((imp) => imp.default)
4343
.then((Store) => {
44-
let store = new Store()
44+
let store = new Store({
45+
migrations: require('./store-migrations').default,
46+
})
4547
console.log("Initiating store")
4648
ipcMain.on('electron-store-get', async (event, val) => {
4749
event.returnValue = store.get(val)

electron/store-migrations.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
'0.2.3': store => {
3+
store.set('PlotsLayoutDefault.defaults.layoutOA-Timeserie', true);
4+
let layout = store.get('PlotsLayoutDefault.defaults.layout')
5+
layout.map((plotLayout) => {
6+
if (plotLayout.plotKey === 'OATimeserie') {
7+
plotLayout.plotKey = 'Hydrograph';
8+
}
9+
});
10+
store.set('PlotsLayoutDefault.defaults.layout', layout);
11+
}
12+
}

0 commit comments

Comments
 (0)