mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
web/menu/roomlist: add confirmation for leaving
This commit is contained in:
parent
62d8d06129
commit
4247e17160
1 changed files with 3 additions and 0 deletions
|
@ -103,6 +103,9 @@ export const RoomMenu = ({ room, style }: RoomMenuProps) => {
|
|||
})
|
||||
}
|
||||
const leaveRoom = () => {
|
||||
if (!window.confirm(`Really leave ${room.meta.current.name}?`)) {
|
||||
return
|
||||
}
|
||||
client.rpc.leaveRoom(room.roomID).catch(err => {
|
||||
console.error("Failed to leave room", err)
|
||||
window.alert(`Failed to leave room: ${err}`)
|
||||
|
|
Loading…
Add table
Reference in a new issue