Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/containers/Toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,19 @@ class Toast extends React.Component {
EventEmitter.removeListener(LISTENER);
}

getToastRef = toast => this.toast = toast;

showToast = ({ message }) => {
this.toast.show(message, 1000);
if (this.toast && this.toast.show) {
this.toast.show(message, 1000);
}
}

render() {
const { theme } = this.props;
return (
<EasyToast
ref={toast => this.toast = toast}
ref={this.getToastRef}
position='center'
style={[styles.toast, { backgroundColor: themes[theme].toastBackground }]}
textStyle={[styles.text, { color: themes[theme].buttonText }]}
Expand Down