Commit a44905db authored by shigemi miura's avatar shigemi miura

Warningモード時に画面が変更されない場合がある不具合を修正

parent 3c61640f
...@@ -214,12 +214,11 @@ struct CustomTabBar: View { ...@@ -214,12 +214,11 @@ struct CustomTabBar: View {
.background(ColorSet.BottomNav.color) .background(ColorSet.BottomNav.color)
.alert("", isPresented: $selectedTabModel.isShowChangeEmrMode) { .alert("", isPresented: $selectedTabModel.isShowChangeEmrMode) {
Button("Yes") { Button("Yes") {
var chatMode = SharingData.message.mode var chatMode = message.mode
chatMode.toggle() chatMode.toggle()
let signalRService = SignalR() let signalRService = SignalR()
signalRService.chatMode(mode: chatMode, completion: responseChatMode) signalRService.chatMode(mode: chatMode, completion: responseChatMode)
SharingData.message.sendInf = true message.sendInf = true
SharingData.message.mode = chatMode
DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) { DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) {
restartChatMode() restartChatMode()
...@@ -265,13 +264,13 @@ struct CustomTabBar: View { ...@@ -265,13 +264,13 @@ struct CustomTabBar: View {
*/ */
func responseChatMode(error: Error?) { func responseChatMode(error: Error?) {
print(debug: "responseChatMode") print(debug: "responseChatMode")
SharingData.message.sendInf = false message.sendInf = false
if let e = error { if let e = error {
print(debug: "Error chat:\(e)") print(debug: "Error chat:\(e)")
isModeAlert = true isModeAlert = true
} else { } else {
SharingData.message.changeMode() message.changeMode()
} }
} }
...@@ -279,7 +278,7 @@ struct CustomTabBar: View { ...@@ -279,7 +278,7 @@ struct CustomTabBar: View {
* モード変更レスポンスが無かった場合 * モード変更レスポンスが無かった場合
*/ */
func restartChatMode() { func restartChatMode() {
if SharingData.message.sendInf { if message.sendInf {
let signalRService = SignalR() let signalRService = SignalR()
signalRService.stopConnection() signalRService.stopConnection()
Thread.sleep(forTimeInterval: 1.0) Thread.sleep(forTimeInterval: 1.0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment