Skip to content

Commit

Permalink
add db
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioolmedo committed Jun 28, 2024
1 parent fa14eb8 commit 23ef795
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions project/js/StorageTest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
// Function to open the IndexedDB
// Add this constant at the top of the file
const DB_NAME = 'threejs-editor';

// Add this new function to get the database name
export function getDatabaseName() {
return DB_NAME;
}

// Update the openTestDatabase function to use the DB_NAME constant
export function openTestDatabase() {
return new Promise((resolve, reject) => {
const request = indexedDB.open('threejs-editor', 2); // Incrementamos a versão para forçar uma atualização
const request = indexedDB.open(DB_NAME, 2); // Incrementamos a versão para forçar uma atualização

request.onupgradeneeded = (event) => {
const db = event.target.result;
Expand Down

0 comments on commit 23ef795

Please sign in to comment.