Skip to content

Commit

Permalink
Fixed minor issue with IDB
Browse files Browse the repository at this point in the history
  • Loading branch information
DAG100 committed Mar 11, 2024
1 parent f9049f8 commit d18ca8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/data_worker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ async function start_IDB() { //if this resolves, the global variable 'db' should
//set up the DB, and if nothing goes wrong (i.e. no errors) then resolve successfully
// console.log("Setting up IDB");
db = event.target?.result;
const objStore = db.createObjectStore("students", {keyPath:"id", autoIncrement:true});
const objStore = db.createObjectStore("students", {keyPath:"key", autoIncrement: false});
objStore.createIndex("students", "students", {unique: false}) //this will hold the array/json string of the response
// console.log("Finished setting up IDB");
//should trigger success event handler now, so we don't resolve the promise here
Expand Down Expand Up @@ -175,7 +175,7 @@ async function update_IDB(students) {
let cursor = event.target?.result;
if (cursor) {
// console.log("Deleting an entry");
trxn.objectStore("students").delete(cursor.value.id)
trxn.objectStore("students").delete(cursor.value.key)
cursor.continue() //move onto next item
} else {
//no more entries left, so store data now
Expand Down
3 changes: 0 additions & 3 deletions components/fadeAnim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ interface FadeAnimProps {
}

const FadeAnim = React.forwardRef((props: FadeAnimProps, ref) => {
console.log("Logging children");
console.log(props.children);
console.log("logged children");
return (
<TransitionGroup
style={props.style}
Expand Down

0 comments on commit d18ca8a

Please sign in to comment.