mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-22 10:11:39 +01:00
Pass in cancellation object
This commit is contained in:
parent
d32d0def36
commit
0588d04742
@ -75,8 +75,9 @@ export class DeviceVerificationViewModel extends ErrorReportViewModel<SegmentTyp
|
||||
this.track(this.sas.disposableOn("VerificationCancelled", (cancellation) => {
|
||||
this.createViewModelAndEmit(
|
||||
new VerificationCancelledViewModel(
|
||||
this.childOptions({ cancellationCode: cancellation!.code, cancelledByUs: cancellation!.cancelledByUs, })
|
||||
));
|
||||
this.childOptions({ cancellation: cancellation! })
|
||||
)
|
||||
);
|
||||
}));
|
||||
this.track(this.sas.disposableOn("VerificationCompleted", (deviceId) => {
|
||||
this.createViewModelAndEmit(
|
||||
|
@ -16,20 +16,20 @@ limitations under the License.
|
||||
|
||||
import {ViewModel, Options as BaseOptions} from "../../../ViewModel";
|
||||
import {SegmentType} from "../../../navigation/index";
|
||||
import {CancelReason} from "../../../../matrix/verification/SAS/channel/types";
|
||||
import type {CancelReason} from "../../../../matrix/verification/SAS/channel/types";
|
||||
import type {IChannel} from "../../../../matrix/verification/SAS/channel/Channel";
|
||||
|
||||
type Options = BaseOptions & {
|
||||
cancellationCode: CancelReason;
|
||||
cancelledByUs: boolean;
|
||||
cancellation: IChannel["cancellation"];
|
||||
};
|
||||
|
||||
export class VerificationCancelledViewModel extends ViewModel<SegmentType, Options> {
|
||||
get cancelCode(): CancelReason {
|
||||
return this.options.cancellationCode;
|
||||
return this.options.cancellation.code;
|
||||
}
|
||||
|
||||
get isCancelledByUs(): boolean {
|
||||
return this.options.cancelledByUs;
|
||||
return this.options.cancellation.cancelledByUs;
|
||||
}
|
||||
|
||||
gotoSettings() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user