mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-26 08:45:20 +00:00
added alert for other leave channel
This commit is contained in:
@@ -819,7 +819,7 @@ struct ContentView: View {
|
|||||||
|
|
||||||
// Leave button
|
// Leave button
|
||||||
Button(action: {
|
Button(action: {
|
||||||
viewModel.leaveChannel(channel)
|
showLeaveChannelAlert = true
|
||||||
}) {
|
}) {
|
||||||
Text("leave channel")
|
Text("leave channel")
|
||||||
.font(.system(size: 10, design: .monospaced))
|
.font(.system(size: 10, design: .monospaced))
|
||||||
@@ -832,6 +832,14 @@ struct ContentView: View {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
|
.alert("Leave Channel", isPresented: $showLeaveChannelAlert) {
|
||||||
|
Button("Cancel", role: .cancel) { }
|
||||||
|
Button("Leave", role: .destructive) {
|
||||||
|
viewModel.leaveChannel(channel)
|
||||||
|
}
|
||||||
|
} message: {
|
||||||
|
Text("Are you sure you want to leave \(channel)?")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user