Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7e7b265f
authored
Dec 25, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
u
parent
84eafea4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
database/dev-tools.ts
database/dev-tools.ts
View file @
7e7b265f
...
@@ -48,10 +48,12 @@ class DevAppTools {
...
@@ -48,10 +48,12 @@ class DevAppTools {
if
(
!
this
.
db
)
{
if
(
!
this
.
db
)
{
return
resolve
(
false
);
return
resolve
(
false
);
}
}
const
store
=
this
.
buildStore
(
this
.
table
);
setTimeout
(()
=>
{
const
r
=
store
.
getKey
(
1
);
const
store
=
this
.
buildStore
(
this
.
table
);
r
.
onsuccess
=
(
o
)
=>
resolve
((
o
.
target
as
any
).
result
);
const
r
=
store
.
getKey
(
1
);
r
.
onerror
=
()
=>
resolve
(
false
);
r
.
onsuccess
=
(
o
)
=>
resolve
((
o
.
target
as
any
).
result
);
r
.
onerror
=
()
=>
resolve
(
false
);
},
200
);
});
});
});
});
}
}
...
@@ -59,19 +61,21 @@ class DevAppTools {
...
@@ -59,19 +61,21 @@ class DevAppTools {
public
toggle
()
{
public
toggle
()
{
return
new
Promise
<
boolean
>
((
resolve
)
=>
{
return
new
Promise
<
boolean
>
((
resolve
)
=>
{
this
.
onReady
().
finally
(()
=>
{
this
.
onReady
().
finally
(()
=>
{
this
.
isOpen
().
then
(
r
=>
{
setTimeout
(()
=>
{
if
(
r
)
{
this
.
isOpen
().
then
(
r
=>
{
const
store
=
this
.
buildStore
(
this
.
table
);
if
(
r
)
{
const
d
=
store
.
delete
(
1
);
const
store
=
this
.
buildStore
(
this
.
table
);
d
.
onsuccess
=
()
=>
resolve
(
false
);
const
d
=
store
.
delete
(
1
);
d
.
onerror
=
()
=>
resolve
(
false
);
d
.
onsuccess
=
()
=>
resolve
(
false
);
}
else
{
d
.
onerror
=
()
=>
resolve
(
false
);
const
store
=
this
.
buildStore
(
this
.
table
);
}
else
{
const
d
=
store
.
add
({
value
:
1
});
const
store
=
this
.
buildStore
(
this
.
table
);
d
.
onsuccess
=
()
=>
resolve
(
true
);
const
d
=
store
.
add
({
value
:
1
});
d
.
onerror
=
()
=>
resolve
(
true
);
d
.
onsuccess
=
()
=>
resolve
(
true
);
}
d
.
onerror
=
()
=>
resolve
(
true
);
});
}
});
},
300
);
});
});
});
});
}
}
...
...
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