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,9 +75,10 @@ export class DeviceVerificationViewModel extends ErrorReportViewModel<SegmentTyp
|
|||||||
this.track(this.sas.disposableOn("VerificationCancelled", (cancellation) => {
|
this.track(this.sas.disposableOn("VerificationCancelled", (cancellation) => {
|
||||||
this.createViewModelAndEmit(
|
this.createViewModelAndEmit(
|
||||||
new VerificationCancelledViewModel(
|
new VerificationCancelledViewModel(
|
||||||
this.childOptions({ cancellationCode: cancellation!.code, cancelledByUs: cancellation!.cancelledByUs, })
|
this.childOptions({ cancellation: cancellation! })
|
||||||
));
|
)
|
||||||
}));
|
);
|
||||||
|
}));
|
||||||
this.track(this.sas.disposableOn("VerificationCompleted", (deviceId) => {
|
this.track(this.sas.disposableOn("VerificationCompleted", (deviceId) => {
|
||||||
this.createViewModelAndEmit(
|
this.createViewModelAndEmit(
|
||||||
new VerificationCompleteViewModel(this.childOptions({ deviceId: deviceId! }))
|
new VerificationCompleteViewModel(this.childOptions({ deviceId: deviceId! }))
|
||||||
|
@ -16,20 +16,20 @@ limitations under the License.
|
|||||||
|
|
||||||
import {ViewModel, Options as BaseOptions} from "../../../ViewModel";
|
import {ViewModel, Options as BaseOptions} from "../../../ViewModel";
|
||||||
import {SegmentType} from "../../../navigation/index";
|
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 & {
|
type Options = BaseOptions & {
|
||||||
cancellationCode: CancelReason;
|
cancellation: IChannel["cancellation"];
|
||||||
cancelledByUs: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export class VerificationCancelledViewModel extends ViewModel<SegmentType, Options> {
|
export class VerificationCancelledViewModel extends ViewModel<SegmentType, Options> {
|
||||||
get cancelCode(): CancelReason {
|
get cancelCode(): CancelReason {
|
||||||
return this.options.cancellationCode;
|
return this.options.cancellation.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
get isCancelledByUs(): boolean {
|
get isCancelledByUs(): boolean {
|
||||||
return this.options.cancelledByUs;
|
return this.options.cancellation.cancelledByUs;
|
||||||
}
|
}
|
||||||
|
|
||||||
gotoSettings() {
|
gotoSettings() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user