mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-18 17:53:42 -05:00
web/settings: add button to go to predecessor room (#612)
Signed-off-by: Sumner Evans <me@sumnerevans.com>
This commit is contained in:
parent
769d60c459
commit
f3dae06346
1 changed files with 9 additions and 0 deletions
|
@ -396,6 +396,11 @@ const SettingsView = ({ room }: SettingsViewProps) => {
|
|||
err => window.alert(`Failed to request OpenID token: ${err}`),
|
||||
)
|
||||
}
|
||||
const previousRoomID = roomMeta.creation_content?.predecessor?.room_id
|
||||
const openPredecessorRoom = () => {
|
||||
window.mainScreenContext.setActiveRoom(previousRoomID!)
|
||||
closeModal()
|
||||
}
|
||||
usePreferences(client.store, room)
|
||||
const globalServer = client.store.serverPreferenceCache
|
||||
const globalLocal = client.store.localPreferenceCache
|
||||
|
@ -419,6 +424,10 @@ const SettingsView = ({ room }: SettingsViewProps) => {
|
|||
<div className="room-buttons">
|
||||
<button className="leave-room" onClick={onClickLeave}>Leave room</button>
|
||||
<button className="devtools" onClick={openDevtools}>Explore room state</button>
|
||||
{previousRoomID &&
|
||||
<button className="previous-room" onClick={openPredecessorRoom}>
|
||||
Open Predecessor Room
|
||||
</button>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue