Show verification UI with navigation

This commit is contained in:
RMidhunSuresh 2023-04-17 22:41:32 +05:30
parent 49db9d810a
commit f3efef365d
2 changed files with 10 additions and 2 deletions

View File

@ -35,6 +35,7 @@ export type SegmentType = {
"members": true;
"member": string;
"device-verification": string | boolean;
"verification": boolean;
"join-room": true;
};
@ -60,7 +61,7 @@ function allowsChild(parent: Segment<SegmentType> | undefined, child: Segment<Se
case "room":
return type === "lightbox" || type === "right-panel";
case "right-panel":
return type === "details"|| type === "members" || type === "member";
return type === "details"|| type === "members" || type === "member" || type === "verification";
case "logout":
return type === "forced";
default:
@ -176,7 +177,7 @@ export function parseUrlPath(urlPath: string, currentNavPath: Path<SegmentType>,
if (sessionSegment) {
segments.push(sessionSegment);
}
} else if (type === "details" || type === "members") {
} else if (type === "details" || type === "members" || type === "verification") {
pushRightPanelSegment(segments, type);
} else if (type === "member") {
let userId = iterator.next().value;

View File

@ -18,6 +18,7 @@ import {ViewModel} from "../../ViewModel";
import {RoomDetailsViewModel} from "./RoomDetailsViewModel.js";
import {MemberListViewModel} from "./MemberListViewModel.js";
import {MemberDetailsViewModel} from "./MemberDetailsViewModel.js";
import {DeviceVerificationViewModel} from "../verification/DeviceVerificationViewModel";
export class RightPanelViewModel extends ViewModel {
constructor(options) {
@ -68,6 +69,12 @@ export class RightPanelViewModel extends ViewModel {
this.urlRouter.pushUrl(url);
}
);
this._hookUpdaterToSegment("verification", DeviceVerificationViewModel, () => {
return {
session: this._session,
room: this._room,
}
});
}
_hookUpdaterToSegment(segment, viewmodel, argCreator, failCallback) {