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 1
1
{
2
2
"name" : " react-native-update" ,
3
- "version" : " 10.26.4 " ,
3
+ "version" : " 10.27.0 " ,
4
4
"description" : " react-native hot update" ,
5
5
"main" : " src/index" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -100,6 +100,14 @@ export const UpdateProvider = ({
100
100
return false ;
101
101
}
102
102
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
+ }
103
111
if ( options . updateStrategy === 'silentAndNow' ) {
104
112
client . switchVersion ( hash ) ;
105
113
return true ;
@@ -134,6 +142,7 @@ export const UpdateProvider = ({
134
142
[
135
143
client ,
136
144
options . updateStrategy ,
145
+ options . afterDownloadUpdate ,
137
146
alertUpdate ,
138
147
alertError ,
139
148
throwErrorIfEnabled ,
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ export interface ClientOptions {
88
88
throwError ?: boolean ;
89
89
beforeCheckUpdate ?: ( ) => Promise < boolean > ;
90
90
beforeDownloadUpdate ?: ( info : CheckResult ) => Promise < boolean > ;
91
+ afterDownloadUpdate ?: ( info : CheckResult ) => Promise < boolean > ;
91
92
}
92
93
93
94
export interface UpdateTestPayload {
You can’t perform that action at this time.
0 commit comments