Remove superfluous try/catch

This commit is contained in:
Julia Friesel
2019-05-06 08:42:43 +02:00
parent 9ee7819462
commit 6a98b28427
+3 -8
View File
@@ -25,17 +25,12 @@ export default class DataManagement extends Component {
} }
startImportFlow = async (shouldDeleteExistingData) => { startImportFlow = async (shouldDeleteExistingData) => {
try { this.startLoading()
this.onStartLoading()
const fileContent = await getFileContent() const fileContent = await getFileContent()
if (fileContent) { if (fileContent) {
await importData(shouldDeleteExistingData, fileContent) await importData(shouldDeleteExistingData, fileContent)
} }
} catch(err) { this.endLoading()
return
} finally {
this.onEndLoading()
}
} }
render() { render() {
@@ -54,7 +49,7 @@ export default class DataManagement extends Component {
<FramedSegment title={labels.import.button}> <FramedSegment title={labels.import.button}>
<AppText>{labels.import.segmentExplainer}</AppText> <AppText>{labels.import.segmentExplainer}</AppText>
<SettingsButton <SettingsButton
onPress= {() => openImportDialog(this.onImportData)} onPress= {() => openImportDialog(this.startImportFlow)}
> >
{labels.import.button} {labels.import.button}
</SettingsButton> </SettingsButton>