Skip to content

Commit b8fd9f3

Browse files
Fixed delete resource - added check if resource is available in state (#96)
1 parent 01f36e5 commit b8fd9f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/controllers/resource-store/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ export const actions: Actions = {
209209
resources.forEach(resource => {
210210
const { type, getKey } = resource;
211211
const key = getKey(routerStoreContext, resourceContext);
212-
const slice = getSliceForResource({ data }, { type, key });
212+
const slice = data[type]?.[key];
213213

214-
if (!slice.expiresAt || slice.expiresAt < Date.now()) {
214+
if (slice && (!slice.expiresAt || slice.expiresAt < Date.now())) {
215215
dispatch(deleteResourceKey(key, type));
216216
}
217217
});

0 commit comments

Comments
 (0)