diff --git a/src/View/Modals/dataTransferModal.tsx b/src/View/Modals/dataTransferModal.tsx index 72ff8eac..49d79829 100644 --- a/src/View/Modals/dataTransferModal.tsx +++ b/src/View/Modals/dataTransferModal.tsx @@ -616,7 +616,7 @@ function DataReceptionModal( + + + + +} diff --git a/src/View/translations.ts b/src/View/translations.ts index 95858a3e..274f6c1b 100644 --- a/src/View/translations.ts +++ b/src/View/translations.ts @@ -120,8 +120,8 @@ const englishTranslations = { /// - transferHeadline: "Copy Your Data", - transferDescription: "If you already use the Coordination Tool on another device, copy your identity here. You can use both devices at the same time.", + transferOptionsHeadline: "Copy Your Data", + transferOptionsDescription: "If you already use the Coordination Tool on another device, copy your identity here. You can use both devices at the same time.", transferOptionTransfer: "Copy here", transferOptionNew: "Set up as new device", @@ -129,6 +129,12 @@ const englishTranslations = { nameHeadline: "Your Name", nameDescription: "This is what others see when you send messages. You can always change your name in settings.", + + // + + transferHeadline: "Data Transfer", + transferDescription: 'On your other device, prepare to transfer your identity and personal data alongside any chats you wish to copy. Then, enter the displayed data here.', + transferButton: "Copy data", }, connectionModal: { diff --git a/src/ViewModel/Global/fileTransferViewModel.ts b/src/ViewModel/Global/fileTransferViewModel.ts index 59a4d422..b68a8025 100644 --- a/src/ViewModel/Global/fileTransferViewModel.ts +++ b/src/ViewModel/Global/fileTransferViewModel.ts @@ -11,6 +11,8 @@ import ChatModel from "../../Model/Chat/chatModel"; export default class FileTransferViewModel extends Context { // state + exitReception: ()=>void|undefined = undefined; + presentedModal: React.State = new React.State(undefined); @@ -216,6 +218,15 @@ export default class FileTransferViewModel extends Context { this.coreViewModel.fileTransferModel.prepareToSend(); }; + correctTransferData = (): void => { + if (this.exitReception != undefined) { + this.presentedModal.value = undefined; + this.exitReception(); + return; + } + this.showTransferDataInputModal() + } + initiateTransfer = (): void => { this.presentedModal.value = FileTransferModals.TransferDisplay; this.didNotFinishSending.value = true; diff --git a/src/ViewModel/Global/onboardingViewModel.ts b/src/ViewModel/Global/onboardingViewModel.ts index 095d2180..46b4f9b7 100644 --- a/src/ViewModel/Global/onboardingViewModel.ts +++ b/src/ViewModel/Global/onboardingViewModel.ts @@ -23,10 +23,15 @@ export default class OnboardingViewModel { setupNew = (): void => { this.presentedModal.value = OnboardingModals.Name; } + + showTransferData = (): void => { + this.presentedModal.value = OnboardingModals.Transfer; + } // methods transferData = (): void => { - this.fileTransferViewModel.showTransferDataInputModal(); + this.fileTransferViewModel.exitReception = ()=>this.showTransferData(); + this.fileTransferViewModel.prepareReceivingData(); this.presentedModal.value = undefined; } @@ -48,5 +53,6 @@ export default class OnboardingViewModel { export enum OnboardingModals { Connection, TransferOrNew, - Name + Name, + Transfer, }