TP-61032 | Codepush Range error crash fix (#10428)

This commit is contained in:
Kshitij Pramod Ghongadi
2024-04-12 17:41:45 +05:30
committed by GitHub
parent b43c40c733
commit 3cce2cd723
2 changed files with 26 additions and 6 deletions

29
App.tsx
View File

@@ -21,10 +21,29 @@ export default class App extends Component<{}> {
getBuildConfigDetails().then((res) => {
flavor = res?.baseUrl;
});
codePush.sync({
installMode: codePush.InstallMode.ON_NEXT_RESUME,
mandatoryInstallMode: codePush.InstallMode.IMMEDIATE,
});
codePush.sync(
{
installMode: codePush.InstallMode.IMMEDIATE,
mandatoryInstallMode: codePush.InstallMode.IMMEDIATE,
},
(status) => {
this.onCodepushStatusChange(status);
}
);
};
onCodepushStatusChange = (status: codePush.SyncStatus) => {
switch (status) {
case codePush.SyncStatus.UPDATE_IGNORED:
logToSentry(
`Codepush Ignored | Status: ${status} | MethodName: onCodepushStatusChange`
);
break;
case codePush.SyncStatus.UNKNOWN_ERROR:
logToSentry(
`Codepush Failed | Status: ${status} | MethodName: onCodepushStatusChange`
);
}
};
getInitialCta = (): CtaData | undefined => {
@@ -61,4 +80,4 @@ export default class App extends Component<{}> {
// return error screen
}
}
}
}

View File

@@ -35,7 +35,8 @@
"react-redux": "^8.1.2",
"redux": "^4.2.1",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.4.2"
"redux-thunk": "^2.4.2",
"whatwg-fetch": "3.6.2"
},
"devDependencies": {
"@types/jest": "^29.5.3",