From cee409fa3317356f07eb78bd579887c4a3602217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ruz=CC=8Cevic=CC=81?= Date: Tue, 4 Jun 2024 20:00:39 +0200 Subject: [PATCH] adding additional options for caching --- CHANGELOG.md | 1 + src/Blocks/components/form/assets/enrichment.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 331e8776..e7ea536c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a ### Added - New `Caching` service for manifest data and new options to flush cache from the settings. - Input number validation for allowed keys. +- WP Rocket cache options settings. ### Fixed - Custom post type labels are not translatable. diff --git a/src/Blocks/components/form/assets/enrichment.js b/src/Blocks/components/form/assets/enrichment.js index 92ec6200..e3e56f04 100644 --- a/src/Blocks/components/form/assets/enrichment.js +++ b/src/Blocks/components/form/assets/enrichment.js @@ -147,7 +147,7 @@ export class Enrichment { return; } - if (!newStorage) { + if (!localStorage || !newStorage) { return; } @@ -228,6 +228,10 @@ export class Enrichment { return null; } + if (!localStorage) { + return null; + } + return localStorage?.getItem(storageName); } @@ -243,6 +247,10 @@ export class Enrichment { return; } + if (!localStorage) { + return; + } + localStorage?.removeItem(storageName); }