Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
30bd4d34
Commit
30bd4d34
authored
Jan 06, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle errors when attempting to clear IndexedDB store
parent
1653c1ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
tests/mock.js
tests/mock.js
+12
-7
No files found.
tests/mock.js
View file @
30bd4d34
...
@@ -223,14 +223,19 @@
...
@@ -223,14 +223,19 @@
function
clearIndexedDB
()
{
function
clearIndexedDB
()
{
const
promise
=
u
.
getResolveablePromise
();
const
promise
=
u
.
getResolveablePromise
();
const
DBOpenR
equest
=
window
.
indexedDB
.
open
(
"
converse-test-persistent
"
);
const
db_r
equest
=
window
.
indexedDB
.
open
(
"
converse-test-persistent
"
);
DBOpenR
equest
.
onsuccess
=
function
()
{
db_r
equest
.
onsuccess
=
function
()
{
const
db
=
DBOpenR
equest
.
result
;
const
db
=
db_r
equest
.
result
;
const
bare_jid
=
"
romeo@montague.lit
"
;
const
bare_jid
=
"
romeo@montague.lit
"
;
const
objectStore
=
db
.
transaction
([
bare_jid
],
"
readwrite
"
).
objectStore
(
bare_jid
);
try
{
const
objectStoreRequest
=
objectStore
.
clear
();
const
store
=
db
.
transaction
([
bare_jid
],
"
readwrite
"
).
objectStore
(
bare_jid
);
objectStoreRequest
.
onsuccess
=
promise
.
resolve
();
}
catch
(
e
)
{
objectStoreRequest
.
onerror
=
promise
.
resolve
();
console
.
error
(
e
);
return
promise
.
resolve
();
}
const
request
=
store
.
clear
();
request
.
onsuccess
=
promise
.
resolve
();
request
.
onerror
=
promise
.
resolve
();
};
};
return
promise
;
return
promise
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment