차트 설정 수정
This commit is contained in:
@@ -515,7 +515,7 @@ export default function StrategyEditorPage({ theme }: Props) {
|
||||
if (!hasRegisteredUser()) return;
|
||||
loadStrategies().then(async list => {
|
||||
if (list?.length) {
|
||||
setStrategies(list.map(s => ({
|
||||
const mapped = list.map(s => ({
|
||||
id: s.id ?? Date.now(),
|
||||
name: s.name,
|
||||
description: s.description,
|
||||
@@ -525,7 +525,11 @@ export default function StrategyEditorPage({ theme }: Props) {
|
||||
enabled: s.enabled ?? true,
|
||||
createdAt: s.createdAt,
|
||||
updatedAt: s.updatedAt,
|
||||
})));
|
||||
}));
|
||||
setStrategies(mapped);
|
||||
setSelectedId(prev =>
|
||||
prev != null && mapped.some(x => x.id === prev) ? prev : null,
|
||||
);
|
||||
} else {
|
||||
const local = loadStratsLocal();
|
||||
if (!local.length) return;
|
||||
|
||||
Reference in New Issue
Block a user