[CodeFactor] Apply fixes to commit ec34a69

This commit is contained in:
codefactor-io 2024-02-10 12:57:33 +00:00
parent ec34a690e9
commit 74d79204ec
No known key found for this signature in database
GPG key ID: B66B2D63282C190F
2 changed files with 9 additions and 8 deletions

View file

@ -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();

View file

@ -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();