From aa914e35d8cc02e39fa8684da76815975213609e Mon Sep 17 00:00:00 2001 From: David Souther Date: Sat, 4 Feb 2023 16:55:23 -0800 Subject: [PATCH] Always load the new chip, then switch to the builtin if necessary. (#189) Closes #187. --- components/src/stores/chip.store.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/src/stores/chip.store.ts b/components/src/stores/chip.store.ts index c92d12540..fdcac8885 100644 --- a/components/src/stores/chip.store.ts +++ b/components/src/stores/chip.store.ts @@ -233,16 +233,15 @@ export function makeChipStore( this.setChip(CHIP_PROJECTS[project][0]); }, - setChip( + async setChip( chip: string, project = storage["/chip/project"] ?? ChipProjects["01"] ) { chipName = storage["/chip/chip"] = chip; dispatch.current({ action: "setChip", payload: chipName }); + await this.loadChip(project, chipName); if (usingBuiltin) { this.useBuiltin(); - } else { - this.loadChip(project, chipName); } },