Fix chat task accept - don't set taskAccepted flag to avoid unwanted navigation
This commit is contained in:
parent
c020fca1d6
commit
4712f40c8b
1 changed files with 3 additions and 2 deletions
|
|
@ -682,13 +682,14 @@ struct TaskDetailScreen: View {
|
||||||
Task {
|
Task {
|
||||||
do {
|
do {
|
||||||
try await APIService.shared.acceptTask(taskId: task.taskId)
|
try await APIService.shared.acceptTask(taskId: task.taskId)
|
||||||
taskAccepted = true
|
|
||||||
|
|
||||||
if task.isChat {
|
if task.isChat {
|
||||||
// Go directly to chat for chat tasks
|
// Go directly to chat for chat tasks
|
||||||
|
// Don't set taskAccepted to avoid triggering unwanted state changes
|
||||||
showingChat = true
|
showingChat = true
|
||||||
} else {
|
} else {
|
||||||
// Stay on detail screen, start beacon scanning if applicable
|
// Stay on detail screen
|
||||||
|
taskAccepted = true
|
||||||
if let d = details, d.servicePointId > 0 {
|
if let d = details, d.servicePointId > 0 {
|
||||||
startBeaconScanning(d.servicePointId)
|
startBeaconScanning(d.servicePointId)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue