Skip to content

Commit

Permalink
fix: add check for index field in examples cached metadata, reset cac…
Browse files Browse the repository at this point in the history
…he if not (for smooth upgrade)
  • Loading branch information
vemonet committed Oct 25, 2024
1 parent 7c98268 commit 439525a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sparql-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export class SparqlEditor extends HTMLElement {
super();

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

0 comments on commit 439525a

Please sign in to comment.