Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

restore dialog

ammarahm-ed0c651d3b7037
diff --git a/apps/mobile/src/components/RestoreDialog/index.js b/apps/mobile/src/components/RestoreDialog/index.js
index afd338ee4..da0933ff5 100644
--- a/apps/mobile/src/components/RestoreDialog/index.js
+++ b/apps/mobile/src/components/RestoreDialog/index.js
@@ -1,5 +1,6 @@
import React, {createRef, useEffect, useState} from 'react';
import {ScrollView} from 'react-native';
+import {ActivityIndicator} from 'react-native';
import {FlatList, Platform, View} from 'react-native';
import DocumentPicker from 'react-native-document-picker';
import {useSafeAreaInsets} from 'react-native-safe-area-context';
@@ -35,7 +36,7 @@ const RestoreDialog = () => {
const {colors} = state;
const [visible, setVisible] = useState(false);
const [files, setFiles] = useState([]);
- const [restoring, setRestoring] = useState(false);
+ const [restoring, setRestoring] = useState(true);
const insets = useSafeAreaInsets();
useEffect(() => {
eSubscribeEvent(eOpenRestoreDialog, open);
@@ -144,7 +145,8 @@ const RestoreDialog = () => {
<ActionSheet
ref={actionSheetRef}
containerStyle={style}
- gestureEnabled
+ gestureEnabled={!restoring}
+ closeOnTouchBackdrop={!restoring}
initialOffsetFromBottom={1}
onClose={close}
onOpen={() => checkBackups()}>
@@ -155,6 +157,7 @@ const RestoreDialog = () => {
justifyContent: 'space-between',
paddingHorizontal: 12,
alignItems: 'center',
+ paddingTop: restoring ? 25 : 0,
}}>
<DialogHeader
title="Backups"
@@ -215,6 +218,31 @@ const RestoreDialog = () => {
</View>
)}
+ {!restoring ? null : (
+ <View
+ style={{
+ justifyContent: 'center',
+ alignItems: 'center',
+ }}>
+ <ActivityIndicator color={colors.accent} />
+ <Paragraph color={colors.icon}>
+ Restoring backup. Please wait.
+ </Paragraph>
+
+ <Button
+ title="Cancel"
+ type="accent"
+ onPress={() => {
+ setRestoring(false);
+ }}
+ height={25}
+ style={{
+ marginTop: 5,
+ }}
+ />
+ </View>
+ )}
+
{files.map((item, index) => (
<View
style={{