-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade causes event.currentTarget undefined with IndexedDBShim #87
Comments
Hmm it's unclear from the spec which I should be looking at, |
@erik-southmedia : We have worked around this particular issue, so if you could test, that would be great. @aaronpowell , FWIW, according to MDN, |
I'm using db.js with IndexedDBShim for iOS Safari. My HTML5 app opens a database and synchronises data with the server when it starts. However, when db.js gets the "upgrade needed" event and tries to create the schema I get an error in the Safari console about an undefined object for "e.currentTarget.transaction" on line 543 of db.js. This line is:
store = e.currentTarget.transaction.objectStore(tableName);
I don't know if this is correct for IndexedDB but the shim library seems to return events only with "target" defined. So I did a workaround with the following code.
if(e.currentTarget !== undefined)
{
store = e.currentTarget.transaction.objectStore(tableName);
}
else store = e.target.transaction.objectStore(tableName);
I hope this helps someone.
The text was updated successfully, but these errors were encountered: