Skip to content

Commit

Permalink
fix(app-form-builder): skip updating cache if revision not in cache a…
Browse files Browse the repository at this point in the history
…lready
  • Loading branch information
brunozoric authored and adrians5j committed Jan 3, 2025
1 parent fd3bf15 commit 8f29b2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/app-form-builder/src/admin/views/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export const updateLatestRevisionInListCache = (
}

const index = formBuilder.listForms.data.findIndex(item => item.id.startsWith(uniqueId));
if (index < 0) {
return;
}

cache.writeQuery({
...gqlParams,
Expand Down Expand Up @@ -99,6 +102,9 @@ export const removeFormFromListCache = (cache: DataProxy, form: FbRevisionModel)
}

const index = formBuilder.listForms.data.findIndex(item => item.id === form.id);
if (index < 0) {
return;
}

cache.writeQuery({
...gqlParams,
Expand Down

0 comments on commit 8f29b2a

Please sign in to comment.