Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getUpdateMetadata() {
CodePush.getUpdateMetadata(CodePush.UpdateState.RUNNING)
.then((metadata) => {
this.setState({ syncMessage: metadata ? JSON.stringify(metadata) : 'Running binary version', progress: false });
}, (error) => {
this.setState({ syncMessage: `Error: ${error}`, progress: false });
});
}
async getUpdateMetadata() {
try {
this.metadata = await CodePush.getUpdateMetadata(CodePush.UpdateState.RUNNING);
} catch (err) {
this.metadata = `Error: ${err}`;
}
this.progress = false;
}
getUpdateMetadata() {
CodePush.getUpdateMetadata(CodePush.UpdateState.RUNNING)
.then((metadata: LocalPackage) => {
this.setState({ syncMessage: metadata ? JSON.stringify(metadata) : "Running binary version", progress: false });
}, (error: any) => {
this.setState({ syncMessage: "Error: " + error, progress: false });
});
}