diff --git a/public/electron.js b/public/electron.js index adf47135..0dbec01c 100644 --- a/public/electron.js +++ b/public/electron.js @@ -114,18 +114,18 @@ class MenuBuilder { mainWindow.webContents.send("seed"); }, }, - { - label: "&Import Private Keys", - click: () => { - mainWindow.webContents.send("import"); - }, - }, - { - label: "&Export All Private Keys", - click: () => { - mainWindow.webContents.send("exportall"); - }, - }, + //{ + // label: "&Import Private Keys", + // click: () => { + // mainWindow.webContents.send("import"); + // }, + //}, + //{ + // label: "&Export All Private Keys", + // click: () => { + // mainWindow.webContents.send("exportall"); + // }, + //}, { type: "separator" }, { label: "&Pay URI", @@ -184,18 +184,18 @@ class MenuBuilder { mainWindow.webContents.send("seed"); }, }, - { - label: "&Import Private Keys", - click: () => { - mainWindow.webContents.send("import"); - }, - }, - { - label: "&Export All Private Keys", - click: () => { - mainWindow.webContents.send("exportall"); - }, - }, + //{ + // label: "&Import Private Keys", + // click: () => { + // mainWindow.webContents.send("import"); + // }, + //}, + //{ + // label: "&Export All Private Keys", + // click: () => { + // mainWindow.webContents.send("exportall"); + // }, + //}, { type: "separator" }, { label: "&Pay URI", diff --git a/src/components/loadingscreen/LoadingScreen.tsx b/src/components/loadingscreen/LoadingScreen.tsx index 57884860..54e1faa9 100644 --- a/src/components/loadingscreen/LoadingScreen.tsx +++ b/src/components/loadingscreen/LoadingScreen.tsx @@ -133,8 +133,27 @@ class LoadingScreen extends Component { // Try to read the default server const settings = await ipcRenderer.invoke("loadSettings"); - let server = settings?.serveruri || Utils.ZCASH_COMMUNITY; - let chain_name: 'main' | 'test' | 'regtest' = settings?.serverchain_name || 'main'; + console.log(settings); + let server: string, chain_name: 'main' | 'test' | 'regtest'; + if (!settings) { + server = Utils.ZCASH_COMMUNITY; + chain_name = 'main'; + await ipcRenderer.invoke("saveSettings", { key: "serveruri", value: server }); + await ipcRenderer.invoke("saveSettings", { key: "serverchain_name", value: chain_name }); + } else { + if (!settings.serveruri) { + server = Utils.ZCASH_COMMUNITY; + await ipcRenderer.invoke("saveSettings", { key: "serveruri", value: server }); + } else { + server = settings.serveruri; + } + if (!settings.serverchain_name) { + chain_name = 'main'; + await ipcRenderer.invoke("saveSettings", { key: "serverchain_name", value: chain_name }); + } else { + chain_name = settings.serverchain_name; + } + } const newstate = new LoadingScreenState(); Object.assign(newstate, this.state); diff --git a/src/components/serverselectmodal/ServerSelectModal.tsx b/src/components/serverselectmodal/ServerSelectModal.tsx index 9a8864f4..e2a235b6 100644 --- a/src/components/serverselectmodal/ServerSelectModal.tsx +++ b/src/components/serverselectmodal/ServerSelectModal.tsx @@ -50,8 +50,9 @@ export default function ServerSelectModal({ closeModal, openErrorModal }: ModalP useEffect(() => { (async () => { const settings = await ipcRenderer.invoke("loadSettings"); - const currServer: string = settings?.serveruri || ""; - const currChain: 'main' | 'test' | 'regtest' | '' = settings?.serverchain_name || ""; + console.log(settings); + const currServer: string = settings?.serveruri || Utils.ZCASH_COMMUNITY; + const currChain: 'main' | 'test' | 'regtest' | '' = settings?.serverchain_name || "main"; initialServerValue(currServer, currChain); setServer(currServer); setChain(currChain);