forked from TTLApp/time-to-leave
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix TTLApp#889: Adapting calendar window to electron isolated environ…
…ment
- Loading branch information
1 parent
0e26631
commit 647c9c0
Showing
19 changed files
with
233 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use strict'; | ||
|
||
const { ipcMain } = require('electron'); | ||
|
||
import { computeAllTimeBalanceUntilAsync } from '../js/time-balance.js'; | ||
|
||
const Store = require('electron-store'); | ||
|
||
const flexibleStore = new Store({name: 'flexible-store'}); | ||
|
||
function getFlexibleStore() | ||
{ | ||
return flexibleStore.store; | ||
} | ||
|
||
function setupCalendarStore() | ||
{ | ||
ipcMain.handle('GET_FLEXIBLE_STORE_CONTENTS', () => | ||
{ | ||
return getFlexibleStore(); | ||
}); | ||
|
||
ipcMain.handle('SET_FLEXIBLE_STORE_DATA', (event, key, contents) => | ||
{ | ||
flexibleStore.set(key, contents); | ||
return true; | ||
}); | ||
|
||
ipcMain.handle('DELETE_FLEXIBLE_STORE_DATA', (event, key) => | ||
{ | ||
flexibleStore.delete(key); | ||
return true; | ||
}); | ||
|
||
ipcMain.handle('COMPUTE_ALL_TIME_BALANCE_UNTIL', (event, targetDate) => | ||
{ | ||
return computeAllTimeBalanceUntilAsync(targetDate); | ||
}); | ||
} | ||
|
||
export { | ||
setupCalendarStore | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.