Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit 224c91f

Browse files
committed
fix: Modify the function to be asynchronous
1 parent 64ecd86 commit 224c91f

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/interaction/index.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@ export function showToast(options = {}) {
1616
return toast.show(options)
1717
}
1818
// eslint-disable-next-line
19-
export function hideToast(options: {[key: string]: any} = {}){
20-
return toast.hide(0)
21-
.then(() => {
22-
// eslint-disable-next-line
23-
(typeof options.success === "function") && options.success()
24-
// eslint-disable-next-line
25-
(typeof options.complete === "function") && options.complete()
26-
})
19+
export async function hideToast(options: { [key: string]: any } = {}) {
20+
await toast.hide(0);
21+
(typeof options.success === "function") && options.success()
22+
(typeof options.complete === "function") && options.complete()
2723
}
2824

2925

@@ -37,14 +33,10 @@ export function showLoading(options:{[key in string]: any} = {}) {
3733
return toast.show(options)
3834
}
3935

40-
export function hideLoading(options: {[key: string]: any} = {}) {
41-
return toast.hide(0)
42-
.then(() => {
43-
// eslint-disable-next-line
44-
(typeof options.success === "function") && options.success()
45-
// eslint-disable-next-line
46-
(typeof options.complete === "function") && options.complete()
47-
})
36+
export async function hideLoading(options: { [key: string]: any } = {}) {
37+
await toast.hide(0);
38+
(typeof options.success === "function") && options.success()
39+
(typeof options.complete === "function") && options.complete()
4840
}
4941

5042
export function showActionSheet(options = {}) {

0 commit comments

Comments
 (0)