fix config loading
This commit is contained in:
parent
445bcaf130
commit
44a9e2aeb0
@ -58,13 +58,14 @@ export default () => {
|
||||
ipcMain.handle("local-app:addServer", (event, server: Omit<Server, "_id">) => {
|
||||
const servers = settings.get("servers") || [];
|
||||
|
||||
try {
|
||||
// TODO: add proper test to see if server url is valid and points to a real WA server
|
||||
// await fetch(`${server.url}/iframe_api.js`);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return new Error("Invalid server url");
|
||||
}
|
||||
// TODO: add proper test to see if server url is valid and points to a real WA server
|
||||
// try {
|
||||
//
|
||||
// await fetch(`${server.url}/iframe_api.js`);
|
||||
// } catch (e) {
|
||||
// console.error(e);
|
||||
// return new Error("Invalid server url");
|
||||
// }
|
||||
|
||||
const newServer = {
|
||||
...server,
|
||||
|
@ -29,7 +29,7 @@ const defaultSettings: SettingsData = {
|
||||
|
||||
async function init() {
|
||||
let _settings = await Settings.get();
|
||||
if (_settings !== undefined) {
|
||||
if (Object.keys(_settings).length === 0) {
|
||||
_settings = defaultSettings;
|
||||
}
|
||||
settings = _settings as SettingsData;
|
||||
|
Loading…
Reference in New Issue
Block a user