Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_close() {
/* Close the webview. */
Navigation.popToRoot('zeronet.Main').catch(console.log);
}
topBar: {
title: {
text: prettyNumber(descendants, 'Comments'),
},
},
preview: reactTag ? {
reactTag,
commit: true,
} : undefined,
},
},
} as any;
if (isSplitView && isMasterView) {
// Pop to root
await Navigation.popToRoot(UI.iPadDetailComponentId);
// Switch to first tab
await Navigation.mergeOptions(UI.iPadDetailComponentId, { bottomTabs: { currentTabIndex: 0 } });
return when(
// Wait for detail view to appear
() => UI.componentId === UI.iPadDetailComponentId,
// Then push new controller
() => Navigation.push(UI.iPadDetailComponentId, opts),
);
}
return Navigation.push(UI.componentId, opts);
};
async onClickPopToRoot() {
await Navigation.popToRoot(this.props.componentId);
}
popToRoot({ componentId }) {
return Navigation.popToRoot(componentId)
},
const popToRoot = (self) => Navigation.popToRoot(self.props.componentId);
navigationButtonPressed({ buttonId }) {
if (buttonId === 'backButton') {
if (this.props.nextQuestionIndex !== null || !this.props.editMode) {
Navigation.dismissModal(this.props.componentId);
} else {
Navigation.popToRoot(this.props.componentId);
}
}
}
const handlePopPress = () => Navigation.popToRoot(componentId)
setReportAnswer(reportName, answer, updateOnly);
}
if (nextQuestionIndex !== null) {
Navigation.push(componentId, {
component: {
name: 'ForestWatcher.NewReport',
passProps: {
editMode,
reportName,
questionIndex: nextQuestionIndex
}
}
});
} else {
if (editMode) {
Navigation.popToRoot(componentId);
} else {
Navigation.push(componentId, {
component: {
name: 'ForestWatcher.Answers',
passProps: {
reportName
}
}
});
}
}
});
onPress={() => Navigation.popToRoot(this.props.componentId)}>
{'Done'}