Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/local_storage_sync.vue')
-rw-r--r--app/assets/javascripts/vue_shared/components/local_storage_sync.vue10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/local_storage_sync.vue b/app/assets/javascripts/vue_shared/components/local_storage_sync.vue
index 80c03342f11..33e77b6510c 100644
--- a/app/assets/javascripts/vue_shared/components/local_storage_sync.vue
+++ b/app/assets/javascripts/vue_shared/components/local_storage_sync.vue
@@ -22,11 +22,21 @@ export default {
required: false,
default: true,
},
+ clear: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
},
watch: {
value(newVal) {
this.saveValue(this.serialize(newVal));
},
+ clear(newVal) {
+ if (newVal) {
+ localStorage.removeItem(this.storageKey);
+ }
+ },
},
mounted() {
// On mount, trigger update if we actually have a localStorageValue