mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-04 23:33:11 +08:00
add cresc
This commit is contained in:
@@ -41,6 +41,8 @@ export const UpdateContext = createContext<{
|
||||
lastError?: Error;
|
||||
}>(defaultContext);
|
||||
|
||||
export const usePushy = () => useContext(UpdateContext);
|
||||
export const useUpdate = () => useContext(UpdateContext);
|
||||
|
||||
export const useCresc = () => useContext(UpdateContext);
|
||||
export const usePushy = useUpdate;
|
||||
|
||||
export const useCresc = useUpdate;
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
import { Pushy, Cresc } from './client';
|
||||
import { currentVersion, packageVersion, getCurrentVersionInfo } from './core';
|
||||
import { CheckResult, ProgressData, UpdateTestPayload } from './type';
|
||||
import { ClientContext } from './context';
|
||||
import { UpdateContext } from './context';
|
||||
import { URL } from 'react-native-url-polyfill';
|
||||
import { isInRollout } from './isInRollout';
|
||||
import { log } from './utils';
|
||||
@@ -335,7 +335,7 @@ export const UpdateProvider = ({
|
||||
}, [parseTestPayload]);
|
||||
|
||||
return (
|
||||
<ClientContext.Provider
|
||||
<UpdateContext.Provider
|
||||
value={{
|
||||
checkUpdate,
|
||||
switchVersion,
|
||||
@@ -354,7 +354,7 @@ export const UpdateProvider = ({
|
||||
parseTestQrCode,
|
||||
}}>
|
||||
{children}
|
||||
</ClientContext.Provider>
|
||||
</UpdateContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user