Skip to content

Commit 439525a

Browse files
committed
fix: add check for index field in examples cached metadata, reset cache if not (for smooth upgrade)
1 parent 7c98268 commit 439525a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sparql-editor.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ export class SparqlEditor extends HTMLElement {
6565
super();
6666

6767
this.meta = this.loadMetaFromLocalStorage();
68+
// NOTE: will need to be removed at some point I guess
69+
// Check if examples contain the index field, if not reset cache
70+
if (this.currentEndpoint().examples?.some(example => example.index === undefined)) {
71+
localStorage.removeItem("sparql-editor-metadata");
72+
this.meta = {};
73+
}
6874
// console.log("Loaded metadata from localStorage", this.meta);
6975
this.endpoints = (this.getAttribute("endpoint") || "").split(",").map(e => e.trim());
7076
if (this.endpoints.length === 0)

0 commit comments

Comments
 (0)