mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
[CodeFactor] Apply fixes
This commit is contained in:
parent
98f48295d0
commit
552a5a9ac8
|
@ -14,7 +14,7 @@ import { useStateStore } from "../store/stateStore.js";
|
|||
const state = useStateStore(pinia);
|
||||
|
||||
import { settingsStore as settings } from "../store/settingsStore.js";
|
||||
import {getAppDataPath} from "../js/freedata";
|
||||
import { getAppDataPath } from "../js/freedata";
|
||||
|
||||
import { displayToast } from "./popupHandler.js";
|
||||
|
||||
|
@ -100,7 +100,7 @@ PouchDB.plugin(require("pouchdb-find"));
|
|||
//PouchDB.plugin(require('pouchdb-replication'));
|
||||
PouchDB.plugin(require("pouchdb-upsert"));
|
||||
|
||||
var appDataPath = getAppDataPath()
|
||||
var appDataPath = getAppDataPath();
|
||||
var configFolder = path.join(appDataPath, "FreeDATA");
|
||||
|
||||
var chatDB = path.join(configFolder, "chatDB");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const os = require('os');
|
||||
const path = require('path');
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
|
||||
/**
|
||||
* Binary to ASCII replacement
|
||||
|
@ -101,24 +101,24 @@ export function validateCallsignWithoutSSID(callsign: string) {
|
|||
return true;
|
||||
}
|
||||
|
||||
export function getAppDataPath(){
|
||||
const platform = os.platform();
|
||||
let appDataPath;
|
||||
export function getAppDataPath() {
|
||||
const platform = os.platform();
|
||||
let appDataPath;
|
||||
|
||||
switch (platform) {
|
||||
case 'darwin': // macOS
|
||||
appDataPath = path.join(os.homedir(), 'Library', 'Application Support');
|
||||
break;
|
||||
case 'win32': // Windows
|
||||
appDataPath = process.env.APPDATA || path.join(os.homedir(), 'AppData', 'Roaming');
|
||||
break;
|
||||
case 'linux': // Linux
|
||||
appDataPath = path.join(os.homedir(), '.config');
|
||||
break;
|
||||
default:
|
||||
throw new Error('Unsupported platform');
|
||||
}
|
||||
switch (platform) {
|
||||
case "darwin": // macOS
|
||||
appDataPath = path.join(os.homedir(), "Library", "Application Support");
|
||||
break;
|
||||
case "win32": // Windows
|
||||
appDataPath =
|
||||
process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming");
|
||||
break;
|
||||
case "linux": // Linux
|
||||
appDataPath = path.join(os.homedir(), ".config");
|
||||
break;
|
||||
default:
|
||||
throw new Error("Unsupported platform");
|
||||
}
|
||||
|
||||
return appDataPath;
|
||||
|
||||
}
|
||||
return appDataPath;
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { reactive, ref, watch } from "vue";
|
||||
import { getConfig, setConfig } from "../js/api";
|
||||
import {getAppDataPath} from "../js/freedata";
|
||||
import { getAppDataPath } from "../js/freedata";
|
||||
import fs from "fs";
|
||||
const path = require('path');
|
||||
const path = require("path");
|
||||
const nconf = require("nconf");
|
||||
|
||||
var appDataPath = getAppDataPath()
|
||||
var appDataPath = getAppDataPath();
|
||||
var configFolder = path.join(appDataPath, "FreeDATA");
|
||||
var configPath = path.join(configFolder, "config.json");
|
||||
|
||||
console.log('AppData Path:', appDataPath);
|
||||
console.log("AppData Path:", appDataPath);
|
||||
console.log(configFolder);
|
||||
console.log(configPath);
|
||||
|
||||
|
|
Loading…
Reference in a new issue