implement data transfer on onboarding
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user