Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Chatterbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
element-hq
Chatterbox
Commits
47f0d96c
Commit
47f0d96c
authored
3 years ago
by
Midhun Suresh
Browse files
Options
Downloads
Patches
Plain Diff
Render message composer
parent
0d202144
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Hydrogen.ts
+8
-5
8 additions, 5 deletions
src/Hydrogen.ts
with
8 additions
and
5 deletions
src/Hydrogen.ts
+
8
−
5
View file @
47f0d96c
import
{
Platform
,
Client
,
LoadStatus
,
createNavigation
,
createRouter
,
RoomViewModel
,
TimelineView
,
}
from
"
hydrogen-view-sdk
"
;
import
{
Platform
,
Client
,
LoadStatus
,
createNavigation
,
createRouter
,
RoomViewModel
,
TimelineView
,
ComposerViewModel
,
MessageComposer
}
from
"
hydrogen-view-sdk
"
;
import
assetPaths
from
"
hydrogen-view-sdk/paths/vite
"
;
import
"
hydrogen-view-sdk/style.css
"
;
import
{
IMatrixClient
}
from
"
./types/IMatrixClient
"
;
...
...
@@ -48,16 +48,19 @@ export class Hydrogen implements IMatrixClient {
async
showRoom
(
roomId
:
string
):
Promise
<
void
>
{
const
room
=
this
.
_session
.
rooms
.
get
(
roomId
)
??
await
this
.
_joinRoom
(
roomId
);
const
v
m
=
new
RoomViewModel
({
const
roomV
m
=
new
RoomViewModel
({
room
,
ownUserId
:
this
.
_session
.
userId
,
platform
:
this
.
_platform
,
urlCreator
:
this
.
_urlRouter
,
navigation
:
this
.
_navigation
,
});
await
vm
.
load
();
const
view
=
new
TimelineView
(
vm
.
timelineViewModel
);
this
.
_container
.
appendChild
(
view
.
mount
());
await
roomVm
.
load
();
const
roomView
=
new
TimelineView
(
roomVm
.
timelineViewModel
);
this
.
_container
.
appendChild
(
roomView
.
mount
());
const
composerVm
=
new
ComposerViewModel
(
roomVm
);
const
composerView
=
new
MessageComposer
(
composerVm
);
this
.
_container
.
appendChild
(
composerView
.
mount
());
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment