From d32460ffa833b44c00986fc9847de9e0a555ac63 Mon Sep 17 00:00:00 2001
From: SergeyEzhin <ezhin@mail.ru>
Date: Tue, 17 Aug 2021 15:49:06 +0300
Subject: [PATCH] [DE SSE mobile] Fix Bug 51968

---
 apps/documenteditor/mobile/locale/en.json     |  1 +
 apps/documenteditor/mobile/locale/ru.json     |  1 +
 .../src/controller/settings/Download.jsx      | 36 +++++++++++--------
 apps/spreadsheeteditor/mobile/locale/en.json  |  1 +
 apps/spreadsheeteditor/mobile/locale/ru.json  |  3 +-
 .../src/controller/settings/Download.jsx      | 22 ++++++++----
 6 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/apps/documenteditor/mobile/locale/en.json b/apps/documenteditor/mobile/locale/en.json
index 5db65c176..f176b198f 100644
--- a/apps/documenteditor/mobile/locale/en.json
+++ b/apps/documenteditor/mobile/locale/en.json
@@ -479,6 +479,7 @@
     "textBack": "Back",
     "textBottom": "Bottom",
     "textCancel": "Cancel",
+    "textOk": "Ok",
     "textCaseSensitive": "Case Sensitive",
     "textCentimeter": "Centimeter",
     "textCollaboration": "Collaboration",
diff --git a/apps/documenteditor/mobile/locale/ru.json b/apps/documenteditor/mobile/locale/ru.json
index 5e84fd246..733d4eba7 100644
--- a/apps/documenteditor/mobile/locale/ru.json
+++ b/apps/documenteditor/mobile/locale/ru.json
@@ -479,6 +479,7 @@
     "textBack": "Назад",
     "textBottom": "Нижнее",
     "textCancel": "Отмена",
+    "textOk": "Ок",
     "textCaseSensitive": "С учетом регистра",
     "textCentimeter": "Сантиметр",
     "textCollaboration": "Совместная работа",
diff --git a/apps/documenteditor/mobile/src/controller/settings/Download.jsx b/apps/documenteditor/mobile/src/controller/settings/Download.jsx
index d23411208..1e235a74e 100644
--- a/apps/documenteditor/mobile/src/controller/settings/Download.jsx
+++ b/apps/documenteditor/mobile/src/controller/settings/Download.jsx
@@ -27,21 +27,29 @@ class DownloadController extends Component {
         if(format) {
             this.closeModal();
             if (format == Asc.c_oAscFileType.TXT || format == Asc.c_oAscFileType.RTF) {
-                f7.dialog.confirm(
-                    (format === Asc.c_oAscFileType.TXT) ? _t.textDownloadTxt : _t.textDownloadRtf,
-                    _t.notcriticalErrorTitle,
-                    () => {
-                        if (format == Asc.c_oAscFileType.TXT) {
-                            const isDocReady = this.props.storeAppOptions.isDocReady;
-                            onAdvancedOptions(Asc.c_oAscAdvancedOptionsID.TXT, api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format), _t, isDocReady);
+                f7.dialog.create({
+                    title: _t.notcriticalErrorTitle,
+                    text: (format === Asc.c_oAscFileType.TXT) ? _t.textDownloadTxt : _t.textDownloadRtf,
+                    buttons: [
+                        {
+                            text: _t.textCancel
+                        },
+                        {
+                            text: _t.textOk,
+                            onClick: () => {
+                                if (format == Asc.c_oAscFileType.TXT) {
+                                    const isDocReady = this.props.storeAppOptions.isDocReady;
+                                    onAdvancedOptions(Asc.c_oAscAdvancedOptionsID.TXT, api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format), _t, isDocReady);
+                                }
+                                else {
+                                    setTimeout(() => {
+                                        api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
+                                    }, 400);
+                                }
+                            }
                         }
-                        else {
-                            setTimeout(() => {
-                                api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
-                            }, 400);
-                        }
-                    }
-                );
+                    ],
+                }).open();
             } 
             else {
                 setTimeout(() => {
diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json
index b4771b33e..07771d3b1 100644
--- a/apps/spreadsheeteditor/mobile/locale/en.json
+++ b/apps/spreadsheeteditor/mobile/locale/en.json
@@ -533,6 +533,7 @@
       "textByColumns": "By columns",
       "textByRows": "By rows",
       "textCancel": "Cancel",
+      "textOk": "Ok",
       "textCentimeter": "Centimeter",
       "textCollaboration": "Collaboration",
       "textColorSchemes": "Color Schemes",
diff --git a/apps/spreadsheeteditor/mobile/locale/ru.json b/apps/spreadsheeteditor/mobile/locale/ru.json
index 2d0b761cf..141ab669a 100644
--- a/apps/spreadsheeteditor/mobile/locale/ru.json
+++ b/apps/spreadsheeteditor/mobile/locale/ru.json
@@ -253,7 +253,7 @@
     "saveTitleText": "Сохранение документа",
     "textLoadingDocument": "Загрузка документа",
     "textNo": "Нет",
-    "textOk": "Ok",
+    "textOk": "Ок",
     "textYes": "Да",
     "txtEditingMode": "Установка режима редактирования...",
     "uploadImageTextText": "Загрузка рисунка...",
@@ -532,6 +532,7 @@
       "textByColumns": "По столбцам",
       "textByRows": "По строкам",
       "textCancel": "Отмена",
+      "textOk": "Ок",
       "textCentimeter": "Сантиметр",
       "textCollaboration": "Совместная работа",
       "textColorSchemes": "Цветовые схемы",
diff --git a/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx b/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx
index 6e1ed4b25..4ef545efb 100644
--- a/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx
+++ b/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx
@@ -17,13 +17,21 @@ class DownloadController extends Component {
 
         if (format) {
             if (format == Asc.c_oAscFileType.CSV) {
-                f7.dialog.confirm(
-                    _t.warnDownloadAs,
-                    _t.notcriticalErrorTitle,
-                    function () {
-                        onAdvancedOptions(Asc.c_oAscAdvancedOptionsID.CSV, api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format), _t, true);
-                    }
-                )
+                f7.dialog.create({
+                    title: _t.notcriticalErrorTitle,
+                    text: _t.warnDownloadAs,
+                    buttons: [
+                        {
+                            text: _t.textCancel
+                        },
+                        {
+                            text: _t.textOk,
+                            onClick: () => {
+                                onAdvancedOptions(Asc.c_oAscAdvancedOptionsID.CSV, api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format), _t, true);
+                            }
+                        }
+                    ]
+                }).open();
             } else {
                 api.asc_DownloadAs(new Asc.asc_CDownloadOptions(format));
             }