This commit is contained in:
Joep 2023-09-10 17:29:48 +02:00
parent 4714b6bc75
commit 8bd72bffa4

View File

@ -248,7 +248,7 @@ const debounceTimeout = ref<number | null>(null);
const commandObject = ref<{
[key in keyof SettingsCommand]: string;
}>({});
const shellValue = ref<string>("")
const shellValue = ref<string>("");
const $showError = inject<TToast>("$showError") as TToast;
const $showSuccess = inject<TToast>("$showSuccess") as TToast;
@ -307,16 +307,16 @@ const save = async () => {
// @ts-ignore
for (const name of Object.keys(settings.value.commands)) {
// @ts-ignore
const newValue = commandObject.value[name]
const newValue = commandObject.value[name];
// @ts-ignore
if(name in commandObject.value && !Array.isArray(newValue)) {
if (name in commandObject.value && !Array.isArray(newValue)) {
// @ts-ignore
newSettings.commands[name] = newValue
.split("\n")
.filter((cmd: string) => cmd !== "");
.split("\n")
.filter((cmd: string) => cmd !== "");
} else {
// @ts-ignore
newSettings.commands[name] = newValue
newSettings.commands[name] = newValue;
}
}
newSettings.shell = shellValue.value.split("\n");
@ -381,7 +381,7 @@ onMounted(async () => {
originalSettings.value = original;
settings.value = newSettings;
// @ts-ignore
shellValue.value = newSettings.shell.join("\n")
shellValue.value = newSettings.shell.join("\n");
} catch (e) {
error.value = e;
} finally {