1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

Revert "Mobile: Refactored and made dialog boxes more reliable"

This reverts commit f432734338.

This new package has its own glitches and doesn't look good
when button labels are too large. So reverting to the less
glitchy package.
This commit is contained in:
Laurent Cozic
2020-06-13 16:20:59 +01:00
parent 9a9cfbd130
commit 1dc4516efc
15 changed files with 153 additions and 206 deletions

View File

@ -9,7 +9,8 @@ const { BaseScreenComponent } = require('lib/components/base-screen.js');
const { themeStyle } = require('lib/components/global-style.js');
const { time } = require('lib/time-utils.js');
const shared = require('lib/components/shared/encryption-config-shared.js');
const dialogs = require('lib/components/dialogs.js').default;
const { dialogs } = require('lib/dialogs.js');
const DialogBox = require('react-native-dialogbox').default;
class EncryptionConfigScreenComponent extends BaseScreenComponent {
static navigationOptions() {
@ -140,7 +141,7 @@ class EncryptionConfigScreenComponent extends BaseScreenComponent {
await EncryptionService.instance().generateMasterKeyAndEnableEncryption(password);
this.setState({ passwordPromptShow: false });
} catch (error) {
await dialogs.error(error.message);
await dialogs.error(this, error.message);
}
};
@ -211,13 +212,13 @@ class EncryptionConfigScreenComponent extends BaseScreenComponent {
const onToggleButtonClick = async () => {
if (this.props.encryptionEnabled) {
const ok = await dialogs.confirm(_('Disabling encryption means *all* your notes and attachments are going to be re-synchronised and sent unencrypted to the sync target. Do you wish to continue?'));
const ok = await dialogs.confirm(this, _('Disabling encryption means *all* your notes and attachments are going to be re-synchronised and sent unencrypted to the sync target. Do you wish to continue?'));
if (!ok) return;
try {
await EncryptionService.instance().disableEncryption();
} catch (error) {
await dialogs.error(error.message);
await dialogs.error(this, error.message);
}
} else {
this.setState({
@ -284,6 +285,11 @@ class EncryptionConfigScreenComponent extends BaseScreenComponent {
{nonExistingMasterKeySection}
<View style={{ flex: 1, height: 20 }}></View>
</ScrollView>
<DialogBox
ref={dialogbox => {
this.dialogbox = dialogbox;
}}
/>
</View>
);
}