heynote/electron/preload/about-preload.js
Jonatan Heyman 459fcd7c4c Add About dialog
The about dialog contains version info as well as the timestamp for the currency exchange rates.
2023-07-08 16:47:25 +02:00

14 lines
454 B
JavaScript

import { ipcRenderer } from "electron"
import CONFIG from "../config"
ipcRenderer.on("init", function (evt, data) {
document.getElementById("version").innerText = data.version;
let currency = CONFIG.get("currency")
if (currency && currency.data && currency.data.timestamp) {
const date = new Date(currency.data.timestamp * 1000);
document.getElementById("currencyTimestamp").innerText = date.toLocaleString()
}
});