mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-13 03:33:50 +00:00
remember last used config on reload
This commit is contained in:
parent
5ada9e5a0b
commit
3cb7d75601
|
@ -154,7 +154,7 @@ onMounted(async () => {
|
||||||
: 1,
|
: 1,
|
||||||
);
|
);
|
||||||
pairlistStore.selectOrCreateConfig(
|
pairlistStore.selectOrCreateConfig(
|
||||||
pairlistStore.savedConfigs.length > 0 ? pairlistStore.savedConfigs[0].name : 'default',
|
pairlistStore.isSavedConfig(pairlistStore.configName) ? pairlistStore.configName : 'default',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -55,9 +55,8 @@ export const usePairlistConfigStore = defineStore(
|
||||||
return JSON.stringify(configToPayloadItems(), null, 2);
|
return JSON.stringify(configToPayloadItems(), null, 2);
|
||||||
});
|
});
|
||||||
|
|
||||||
const isSavedConfig = computed(
|
const isSavedConfig = (name: string) =>
|
||||||
() => savedConfigs.value.findIndex((c) => c.name === config.value.name) > -1,
|
savedConfigs.value.findIndex((c) => c.name === name) > -1;
|
||||||
);
|
|
||||||
|
|
||||||
function addToConfig(pairlist: Pairlist, index: number) {
|
function addToConfig(pairlist: Pairlist, index: number) {
|
||||||
pairlist = structuredClone(toRaw(pairlist));
|
pairlist = structuredClone(toRaw(pairlist));
|
||||||
|
@ -249,7 +248,7 @@ export const usePairlistConfigStore = defineStore(
|
||||||
{
|
{
|
||||||
persist: {
|
persist: {
|
||||||
key: 'ftPairlistConfig',
|
key: 'ftPairlistConfig',
|
||||||
paths: ['savedConfigs'],
|
paths: ['savedConfigs', 'configName'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user