Skip to content

Commit

Permalink
Versionning du localStorage (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
lowzonenose authored Oct 19, 2024
1 parent 6feee47 commit 2b67562
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/stores/mapStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ const ns = ((value) => {
return NAMESPACE + '.' + value;
});

/**
* Versionning du localStorage
*
* Version à incrementer si "break change" du localStorage,
* on procède à son nettoyage.
*/
const VERSION = "0";

var version = localStorage.getItem(ns('version'));
if (!version || version !== VERSION) {
localStorage.clear();
localStorage.setItem(ns('version'), VERSION);
}

/**
* @description
* Store des objets de la carte
Expand Down

0 comments on commit 2b67562

Please sign in to comment.