File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " react-native-update" ,
3- "version" : " 10.26.4 " ,
3+ "version" : " 10.27.0 " ,
44 "description" : " react-native hot update" ,
55 "main" : " src/index" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -100,6 +100,14 @@ export const UpdateProvider = ({
100100 return false ;
101101 }
102102 stateListener . current && stateListener . current . remove ( ) ;
103+
104+ if (
105+ options . afterDownloadUpdate &&
106+ ( await options . afterDownloadUpdate ( info ) ) === false
107+ ) {
108+ log ( 'afterDownloadUpdate returned false, skipping' ) ;
109+ return false ;
110+ }
103111 if ( options . updateStrategy === 'silentAndNow' ) {
104112 client . switchVersion ( hash ) ;
105113 return true ;
@@ -134,6 +142,7 @@ export const UpdateProvider = ({
134142 [
135143 client ,
136144 options . updateStrategy ,
145+ options . afterDownloadUpdate ,
137146 alertUpdate ,
138147 alertError ,
139148 throwErrorIfEnabled ,
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ export interface ClientOptions {
8888 throwError ?: boolean ;
8989 beforeCheckUpdate ?: ( ) => Promise < boolean > ;
9090 beforeDownloadUpdate ?: ( info : CheckResult ) => Promise < boolean > ;
91+ afterDownloadUpdate ?: ( info : CheckResult ) => Promise < boolean > ;
9192}
9293
9394export interface UpdateTestPayload {
You can’t perform that action at this time.
0 commit comments