mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
Show verification UI with navigation
This commit is contained in:
parent
49db9d810a
commit
f3efef365d
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user