Skip to content
Snippets Groups Projects
Commit 4bff5a3d authored by MariaZ's avatar MariaZ
Browse files

Move toast showing function to helper

parent 233d1496
No related branches found
No related tags found
No related merge requests found
import Toast from 'react-native-simple-toast'
export const showToast = (text) => Toast.show(
text, Toast.SHORT, ['RCTModalHostViewController', 'UIAlertController']
)
......@@ -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)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment