Skip to content

Commit

Permalink
delete object-store only iff pre-existing
Browse files Browse the repository at this point in the history
  • Loading branch information
eisserer committed Jul 3, 2024
1 parent ba1a447 commit 8e940db
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link rel="icon" type="image/x-icon" href="https://openlayers.org/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>URL Rewriter Demo</title>
<script type="module" crossorigin src="./assets/index--B7RQ0zz.js"></script>
<script type="module" crossorigin src="./assets/index-bF6XNE2K.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BhANU1rx.css">
<script id="vite-plugin-pwa:register-sw" src="./registerSW.js"></script></head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion docs/sw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/sw.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ let vectorLayer = new VectorLayer();

const idb = await openDB('hofapp', 3, {
upgrade(db, oldVersion, newVersion, transaction, event) {
db.deleteObjectStore('imgs');
if(db.objectStore(imgs)) {
db.deleteObjectStore('imgs');
}
const imgStore = db.createObjectStore('imgs', { keyPath: 'url' });
imgStore.createIndex("url", "url");
}
Expand Down

0 comments on commit 8e940db

Please sign in to comment.