Move toast showing function to helper

This commit is contained in:
MariaZ
2021-08-29 14:03:29 +02:00
parent 233d14968d
commit 4bff5a3d68
2 changed files with 7 additions and 2 deletions
@@ -2,7 +2,6 @@ import React, { Component } from 'react'
import RNFS from 'react-native-fs'
import { Alert } from 'react-native'
import PropTypes from 'prop-types'
import Toast from 'react-native-simple-toast'
import Button from '../../common/button'
@@ -10,6 +9,7 @@ import ConfirmWithPassword from '../common/confirm-with-password'
import alertError from '../common/alert-error'
import { clearDb, isDbEmpty } from '../../../db'
import { showToast } from '../../helpers/general'
import { hasEncryptionObservable } from '../../../local-storage'
import settings from '../../../i18n/en/settings'
import { shared as sharedLabels } from '../../../i18n/en/labels'
@@ -70,7 +70,7 @@ export default class DeleteData extends Component {
clearDb()
}
await this.deleteExportedFile()
Toast.show(success.message, Toast.LONG)
showToast(success.message)
} catch (err) {
alertError(errors.couldNotDeleteFile)
}