Skip to content

Commit b81ae91

Browse files
committed
settings: add button to go to predecessor room
Signed-off-by: Sumner Evans <[email protected]>
1 parent 769d60c commit b81ae91

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

web/src/ui/settings/SettingsView.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,11 @@ const SettingsView = ({ room }: SettingsViewProps) => {
396396
err => window.alert(`Failed to request OpenID token: ${err}`),
397397
)
398398
}
399+
const previousRoomID = roomMeta.creation_content?.predecessor?.room_id
400+
const openPredecessorRoom = () => {
401+
window.mainScreenContext.setActiveRoom(previousRoomID!)
402+
closeModal()
403+
}
399404
usePreferences(client.store, room)
400405
const globalServer = client.store.serverPreferenceCache
401406
const globalLocal = client.store.localPreferenceCache
@@ -419,6 +424,10 @@ const SettingsView = ({ room }: SettingsViewProps) => {
419424
<div className="room-buttons">
420425
<button className="leave-room" onClick={onClickLeave}>Leave room</button>
421426
<button className="devtools" onClick={openDevtools}>Explore room state</button>
427+
{previousRoomID &&
428+
<button className="previous-room" onClick={openPredecessorRoom}>
429+
Open Predecessor Room
430+
</button>}
422431
</div>
423432
</div>
424433
</div>

0 commit comments

Comments
 (0)