From a43756895dc68397c6a53f6db3708bde74fc78ce Mon Sep 17 00:00:00 2001 From: Lisbet Alvarez <107949262+lisbet-alvarez@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:30:43 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20auth-methods=20deleted=20?= =?UTF-8?q?items=20are=20showing=20on=20table=20view=20(#2244)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 🐛 auth-methods deleted items are showing on table view --- addons/api/addon/handlers/indexed-db-handler.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/api/addon/handlers/indexed-db-handler.js b/addons/api/addon/handlers/indexed-db-handler.js index 6719eca78..aea1b2e0f 100644 --- a/addons/api/addon/handlers/indexed-db-handler.js +++ b/addons/api/addon/handlers/indexed-db-handler.js @@ -102,6 +102,12 @@ export default class IndexedDbHandler { if (payload.removed_ids?.length > 0) { await indexedDb[type].bulkDelete(payload.removed_ids); } + // This is a temporary fix of clearing the DB (specifically for auth-methods) + // since we are not storing the token we do not get back a list of removed_ids + // from the API call and we do not want deleted items from showing in list view. + if (!storeToken) { + await indexedDb[type].clear(); + } const normalizedPayload = serializer.normalizeResponse( store,