File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
frontend/iframe/viewmodels Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 11import { SessionViewModel as BaseSessionViewModel } from "hydrogen-web/src/domain/session/SessionViewModel" ;
22import { RoomViewModel } from "./RoomViewModel" ;
3+ import { UnknownRoomViewModel } from "./UnknownRoomVideoModel" ;
34import { SettingsViewModel } from "./SettingsViewModel" ;
45
56export class SessionViewModel extends BaseSessionViewModel {
@@ -110,4 +111,14 @@ export class SessionViewModel extends BaseSessionViewModel {
110111 }
111112 return null ;
112113 }
114+
115+ async _createUnknownRoomViewModel ( roomIdOrAlias , isWorldReadablePromise ) {
116+ return new UnknownRoomViewModel ( super . childOptions ( {
117+ roomIdOrAlias,
118+ session : this . client . session ,
119+ isWorldReadablePromise : isWorldReadablePromise ,
120+ guestJoinAllowed : false ,
121+ singleRoomId : this . _singleRoomId ,
122+ } ) ) ;
123+ }
113124}
Original file line number Diff line number Diff line change 1+ import { UnknownRoomViewModel as BaseUnknownRoomViewModel } from "hydrogen-web/src/domain/session/room/UnknownRoomViewModel" ;
2+ import { SegmentType } from "hydrogen-web/src/domain/navigation" ;
3+ import { Segment } from "hydrogen-web/src/domain/navigation/Navigation" ;
4+
5+ export class UnknownRoomViewModel extends BaseUnknownRoomViewModel {
6+ private readonly _singleRoomId : any ;
7+
8+ constructor ( options ) {
9+ super ( options ) ;
10+ this . _singleRoomId = options . singleRoomId ;
11+ }
12+
13+ get navigation ( ) {
14+ return super . navigation ;
15+ }
16+
17+ get urlRouter ( ) {
18+ return super . urlRouter ;
19+ }
20+
21+ get closeUrl ( ) {
22+ if ( this . _singleRoomId ) {
23+ const path = this . navigation . path . with ( new Segment < SegmentType > ( "session" ) ) ;
24+ return this . urlRouter . urlForPath ( path ) ;
25+ }
26+
27+ return super . closeUrl ;
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments