mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-26 13:05:15 +00:00
hide config delete button if not saved
This commit is contained in:
parent
954100eb63
commit
37c06453df
|
@ -2,7 +2,7 @@
|
|||
<b-input-group class="mb-2">
|
||||
<template #prepend>
|
||||
<b-button
|
||||
:disabled="!pairlistStore.config.name"
|
||||
:disabled="!pairlistStore.isSavedConfig"
|
||||
variant="danger"
|
||||
@click="pairlistStore.deleteConfig()"
|
||||
><i-mdi-close class="fs-4"
|
||||
|
|
|
@ -39,6 +39,10 @@ export const usePairlistConfigStore = defineStore(
|
|||
return JSON.stringify(configToPayloadItems(), null, 2);
|
||||
});
|
||||
|
||||
const isSavedConfig = computed(
|
||||
() => savedConfigs.value.findIndex((c) => c.name === config.value.name) > -1,
|
||||
);
|
||||
|
||||
function addToConfig(pairlist: Pairlist, index: number) {
|
||||
pairlist = structuredClone(toRaw(pairlist));
|
||||
for (const param in pairlist.params) {
|
||||
|
@ -161,6 +165,7 @@ export const usePairlistConfigStore = defineStore(
|
|||
newConfig,
|
||||
addToBlacklist,
|
||||
removeFromBlacklist,
|
||||
isSavedConfig,
|
||||
firstPairlistIsGenerator,
|
||||
pairlistValid,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user