implement data transfer on onboarding

This commit is contained in:
marlon-erler
2026-09-29 20:55:24 +02:00
parent 357fe4a311
commit fbc40b5e3e
5 changed files with 121 additions and 8 deletions
@@ -11,6 +11,8 @@ import ChatModel from "../../Model/Chat/chatModel";
export default class FileTransferViewModel extends Context {
// state
exitReception: ()=>void|undefined = undefined;
presentedModal: React.State<FileTransferModals | undefined> =
new React.State<any>(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;
+8 -2
View File
@@ -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,
}