mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
[CodeFactor] Apply fixes to commit ec34a69
This commit is contained in:
parent
ec34a690e9
commit
74d79204ec
2 changed files with 9 additions and 8 deletions
|
@ -24,7 +24,10 @@ setActivePinia(pinia);
|
|||
import { useStateStore } from "../store/stateStore.js";
|
||||
const stateStore = useStateStore(pinia);
|
||||
|
||||
import { settingsStore as settings, getRemote } from "../store/settingsStore.js";
|
||||
import {
|
||||
settingsStore as settings,
|
||||
getRemote,
|
||||
} from "../store/settingsStore.js";
|
||||
|
||||
export function connectionFailed(endpoint, event) {
|
||||
stateStore.modem_connection = "disconnected";
|
||||
|
@ -129,10 +132,9 @@ export function eventDispatcher(data) {
|
|||
displayToast("success", "bi-ethernet", message, 5000);
|
||||
stateStore.modem_connection = "connected";
|
||||
|
||||
|
||||
getRemote().then(() => {
|
||||
//initConnections();
|
||||
getModemState();
|
||||
//initConnections();
|
||||
getModemState();
|
||||
});
|
||||
|
||||
//getConfig();
|
||||
|
|
|
@ -99,7 +99,7 @@ const defaultConfig = {
|
|||
tci_port: 0,
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
nconf.defaults(defaultConfig.local);
|
||||
nconf.required(["local:host", "local:port"]);
|
||||
|
@ -118,17 +118,16 @@ export function onChange() {
|
|||
|
||||
export function getRemote() {
|
||||
return getConfig().then((conf) => {
|
||||
if (typeof conf !== 'undefined') {
|
||||
if (typeof conf !== "undefined") {
|
||||
settingsStore.remote = conf;
|
||||
onChange();
|
||||
} else {
|
||||
console.warn('Received undefined configuration, using default!');
|
||||
console.warn("Received undefined configuration, using default!");
|
||||
settingsStore.remote = defaultConfig.remote;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
watch(settingsStore.local, (oldValue, newValue) => {
|
||||
//This function watches for changes, and triggers a save of local settings
|
||||
saveLocalSettingsToConfig();
|
||||
|
|
Loading…
Reference in a new issue