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

fix: Modify the function to be asynchronous #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions src/interaction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ export function showToast(options = {}) {
return toast.show(options)
}
// eslint-disable-next-line
export function hideToast(options: {[key: string]: any} = {}){
return toast.hide(0)
.then(() => {
// eslint-disable-next-line
(typeof options.success === "function") && options.success()
// eslint-disable-next-line
(typeof options.complete === "function") && options.complete()
})
export async function hideToast(options: { [key: string]: any } = {}) {
await toast.hide(0);
(typeof options.success === "function") && options.success()
(typeof options.complete === "function") && options.complete()
}


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

export function hideLoading(options: {[key: string]: any} = {}) {
return toast.hide(0)
.then(() => {
// eslint-disable-next-line
(typeof options.success === "function") && options.success()
// eslint-disable-next-line
(typeof options.complete === "function") && options.complete()
})
export async function hideLoading(options: { [key: string]: any } = {}) {
await toast.hide(0);
(typeof options.success === "function") && options.success()
(typeof options.complete === "function") && options.complete()
}

export function showActionSheet(options = {}) {
Expand Down