Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path')
const { Monitor, CHANGED_TYPES } = require('./monitor')
const { app, Menu, Notification, Tray, nativeImage, BrowserWindow, ipcMain } = require('electron')
const { app, Menu, Notification, Tray, nativeImage, BrowserWindow, ipcMain, shell } = require('electron')
const { isDev, getIpcStoreKey } = require('./tool')
const { store, STORE_KEY } = require('./store')
const logger = require('electron-log')
Expand Down Expand Up @@ -157,7 +157,7 @@ function initMenuBar () {
})
}
},
{ label: 'Help', role: 'help' },
{ label: 'Help', role: 'help', click: () => shell.openExternal('https://github.com/reply2future/dmonitor/issues') },
{ type: 'separator' },
{ label: 'Quit', role: 'quit' }
]
Expand All @@ -179,6 +179,7 @@ function initListeners () {
app.whenReady()
.then(() => {
logger.info('It\'s time to initialize')
store.set(STORE_KEY.appInfo, `${app.getName()}:${app.getVersion()}`)
})
.then(initListeners)
.then(initMenuBar)
Expand Down
5 changes: 5 additions & 0 deletions preference.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<input type="checkbox" id="auto-launch" name="auto-launch">
</div>

<footer>
<p id="info"></p>
<p><a href="https://github.com/reply2future/dmonitor/issues">Report bugs</a></p>
</footer>

<script type="text/javascript" src="renderer.js"></script>

</body>
Expand Down
3 changes: 2 additions & 1 deletion preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ contextBridge.exposeInMainWorld('api', {
setStore: (key, value) => {
store.set(key, value)
ipcRenderer.send(getIpcStoreKey(key), value)
}
},
getAppInfo: () => store.get(STORE_KEY.appInfo)
})
3 changes: 3 additions & 0 deletions renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ autoLaunch.addEventListener('change', (event) => {
})

autoLaunch.checked = window.api.getStore(window.api.STORE_KEY.autoLaunch, false)

const info = document.querySelector('#info')
info.innerHTML = window.api.getAppInfo()
3 changes: 2 additions & 1 deletion store.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const store = new Store()

const STORE_KEY = {
silentTimeHr: 'silentTimeHr',
autoLaunch: 'autoLaunch'
autoLaunch: 'autoLaunch',
appInfo: 'appInfo'
}

module.exports = { store, STORE_KEY }