Skip to content

Commit

Permalink
chore(web): fix a layer update process (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
keiya01 committed Sep 27, 2023
1 parent c7d0711 commit 391ef0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/src/beta/lib/core/mantle/atoms/compute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ export function computeAtom(cache?: typeof globalDataFeaturesCache) {
set(computedResult, result);
});

const set = atom(null, async (_get, set, value: Layer | undefined) => {
set(layer, value);
const set = atom(null, async (get, set, value: Layer | undefined) => {
const currentLayer = get(layer);
set(layer, value ? { ...(currentLayer ?? {}), ...value } : undefined);
await set(compute, undefined);
});

Expand Down

0 comments on commit 391ef0f

Please sign in to comment.