From a98a48d665d0946999f7c507620753be55d52c31 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Sun, 25 Feb 2024 00:03:35 +0800 Subject: [PATCH] fix: type --- src/context.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/context.ts b/src/context.ts index 169d728..a43cd7f 100644 --- a/src/context.ts +++ b/src/context.ts @@ -2,28 +2,28 @@ import { createContext, useContext } from 'react'; import { CheckResult, ProgressData } from './type'; import { Pushy } from './client'; -const empty = {}; const noop = () => {}; +const asyncNoop = () => Promise.resolve(); export const defaultContext = { - checkUpdate: () => Promise.resolve(empty), + checkUpdate: asyncNoop, switchVersion: noop, switchVersionLater: noop, markSuccess: noop, dismissError: noop, - downloadUpdate: noop, + downloadUpdate: asyncNoop, downloadAndInstallApk: noop, currentHash: '', packageVersion: '', }; export const PushyContext = createContext<{ - checkUpdate: () => void; + checkUpdate: () => Promise; switchVersion: () => void; switchVersionLater: () => void; markSuccess: () => void; dismissError: () => void; - downloadUpdate: () => void; + downloadUpdate: () => Promise; downloadAndInstallApk: (url: string) => void; currentHash: string; packageVersion: string;