forked from element-hq/hydrogen-web
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Peeking improvements #5
Closed
Closed
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
80f0d74
delete world readable room data when you move away from that room
ashfame 418fa90
handle edge case when homeserver can not return any events even for a…
ashfame 554f517
possible template fix to fix navigating out of unknown room
ashfame e6c4141
split preview view out of UnknownRoomView into WorldReadableRoomView …
ashfame 7bba357
separate WorldReadableRoomViewModel out of UnknownRoomViewModel
ashfame 3a700ba
move WorldReadableRoomView out to its own file and create WorldReadab…
ashfame e9261e5
remove the need of defining a new value in RoomStatus enum
ashfame 8f20f97
make join functional + fix room id being passed to delete during dispose
ashfame 015f796
ensure records are deleted in dispose() except when joining the room
ashfame File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {RoomViewModel} from "./RoomViewModel"; | ||
|
||
export class WorldReadableRoomViewModel extends RoomViewModel { | ||
constructor(options) { | ||
options.room.isWorldReadable = true; | ||
super(options); | ||
this._session = options.session; | ||
} | ||
|
||
get kind() { | ||
return "preview"; | ||
} | ||
|
||
dispose() { | ||
super.dispose(); | ||
void this._session.deleteWorldReadableRoomData(this.roomIdOrAlias); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {TemplateView} from "../../general/TemplateView"; | ||
import {TimelineView} from "./TimelineView"; | ||
import {viewClassForTile} from "./common"; | ||
import {TimelineLoadingView} from "./TimelineLoadingView"; | ||
import {AvatarView} from "../../AvatarView"; | ||
|
||
export class WorldReadableRoomView extends TemplateView { | ||
|
||
constructor(vm) { | ||
super(vm); | ||
} | ||
|
||
render(t, vm) { | ||
return t.div({className: "RoomView WorldReadableRoomView middle"}, [ | ||
t.div({className: "RoomHeader middle-header"}, [ | ||
t.view(new AvatarView(vm, 32)), | ||
t.div({className: "room-description"}, [ | ||
t.h2(vm => vm.room.name), | ||
]), | ||
]), | ||
t.div({className: "RoomView_body"}, [ | ||
t.div({className: "RoomView_error"}, [ | ||
t.if(vm => vm.error, t => t.div([ | ||
t.p({}, vm => vm.error), | ||
t.button({className: "RoomView_error_closerButton", onClick: evt => vm.dismissError(evt)}) | ||
])) | ||
]), | ||
t.mapView(vm => vm.timelineViewModel, timelineViewModel => { | ||
return timelineViewModel ? | ||
new TimelineView(timelineViewModel, viewClassForTile) : | ||
new TimelineLoadingView(vm); // vm is just needed for i18n | ||
}), | ||
t.div({className: "WorldReadableRoomComposerView"}, [ | ||
t.h3(vm => vm.i18n`Join the room to participate`), | ||
t.button({className: "joinRoomButton", onClick: () => vm.join()}, vm.i18n`Join Room`) | ||
]) | ||
]) | ||
]); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@psrpinto Do you think this is fine or it warrants the need of creating a
WorldReadableRoom
likeArchivedRoom
just because we need to differentiate between the room instance of a regular room and WorldReadable room in RoomViewModel?