From ee3cf53e6bfa4a04c470d794f2ada710b701b507 Mon Sep 17 00:00:00 2001 From: Tako Date: Tue, 30 May 2023 15:44:38 +0000 Subject: [PATCH] deleting configs --- src/stores/pairlistConfig.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/stores/pairlistConfig.ts b/src/stores/pairlistConfig.ts index 923709b8..53a9cfb3 100644 --- a/src/stores/pairlistConfig.ts +++ b/src/stores/pairlistConfig.ts @@ -63,6 +63,15 @@ export const usePairlistConfigStore = defineStore( } } + function deleteConfig() { + const i = savedConfigs.value.findIndex((c) => c.name === config.value.name); + console.log(i); + if (i > -1) { + savedConfigs.value.splice(i, 1); + config.value = { name: '', pairlists: [] }; + } + } + function newConfig() { config.value = { name: '', pairlists: [] }; } @@ -147,6 +156,7 @@ export const usePairlistConfigStore = defineStore( addToConfig, removeFromConfig, saveConfig, + deleteConfig, selectConfig, newConfig, addToBlacklist,