You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
Handle reserved names in RN
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import DialogBox from 'react-native-dialogbox';
|
||||
import { Keyboard } from 'react-native';
|
||||
|
||||
// Add this at the bottom of the component:
|
||||
//
|
||||
@ -10,6 +11,8 @@ dialogs.confirm = (parentComponent, message) => {
|
||||
if (!'dialogbox' in parentComponent) throw new Error('A "dialogbox" component must be defined on the parent component!');
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
Keyboard.dismiss();
|
||||
|
||||
parentComponent.dialogbox.confirm({
|
||||
content: message,
|
||||
|
||||
@ -26,7 +29,14 @@ dialogs.confirm = (parentComponent, message) => {
|
||||
},
|
||||
|
||||
});
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
dialogs.error = (parentComponent, message) => {
|
||||
Keyboard.dismiss();
|
||||
return parentComponent.dialogbox.alert(message);
|
||||
}
|
||||
|
||||
dialogs.DialogBox = DialogBox
|
||||
|
||||
export { dialogs };
|
Reference in New Issue
Block a user