Commit 71f416a7 authored by shigemi miura's avatar shigemi miura

NGAで50点以上は+が表示されないように修正

チャット通知OFF処理変更
parent ec125999
...@@ -177,7 +177,6 @@ struct ChatInputView: View { ...@@ -177,7 +177,6 @@ struct ChatInputView: View {
*/ */
func responseChatMessage(error: Error?) { func responseChatMessage(error: Error?) {
if let e = error { if let e = error {
print(debug: "Error chat:\(e)")
msg.messages.removeLast() //最後に追加したメッセージを削除 msg.messages.removeLast() //最後に追加したメッセージを削除
isChatAlert = true isChatAlert = true
} else { } else {
......
...@@ -91,7 +91,9 @@ struct ChatTitleView: View { ...@@ -91,7 +91,9 @@ struct ChatTitleView: View {
isNotification.toggle() isNotification.toggle()
Preferences.ChatNotification = isNotification Preferences.ChatNotification = isNotification
print(debug: "Test: \(isNotification)") let notificationTags = NotificationTags()
notificationTags.addTags()
return isNotification return isNotification
} }
} }
......
...@@ -13,7 +13,6 @@ class EcaTask { ...@@ -13,7 +13,6 @@ class EcaTask {
var eca = SharingData.eca var eca = SharingData.eca
func start() { func start() {
print(debug: "called")
sessionShipStatus.RequestShipStatus(responseShipStatus) sessionShipStatus.RequestShipStatus(responseShipStatus)
} }
...@@ -33,7 +32,6 @@ class EcaTask { ...@@ -33,7 +32,6 @@ class EcaTask {
} }
func responseShipStatus(result: Result<Data, APIError>) { func responseShipStatus(result: Result<Data, APIError>) {
print(debug: "called")
switch result { switch result {
case .success(let resultData): case .success(let resultData):
let serverSession = ServerSession() let serverSession = ServerSession()
...@@ -48,7 +46,7 @@ class EcaTask { ...@@ -48,7 +46,7 @@ class EcaTask {
SharingData.location.dataTime = res.dataTime //2023-11-02T05:25:49.4362123Z SharingData.location.dataTime = res.dataTime //2023-11-02T05:25:49.4362123Z
SharingData.location.setLocation() SharingData.location.setLocation()
print(debug: "Location:\(res)") // print(debug: "Location:\(res)")
} }
case .failure(let errorCode): case .failure(let errorCode):
print(debug: errorCode) print(debug: errorCode)
......
...@@ -83,7 +83,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate { ...@@ -83,7 +83,7 @@ class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
ngaList.start() ngaList.start()
if let newLocation = locations.first { if let newLocation = locations.first {
print(debug: "called locationManager") // print(debug: "called locationManager")
lastSeenLocation = newLocation lastSeenLocation = newLocation
let targetCoordinate : CLLocationCoordinate2D = lastSeenLocation!.coordinate let targetCoordinate : CLLocationCoordinate2D = lastSeenLocation!.coordinate
SharingData.location.gps = targetCoordinate SharingData.location.gps = targetCoordinate
......
...@@ -733,18 +733,18 @@ class MapViewController : UIViewController { ...@@ -733,18 +733,18 @@ class MapViewController : UIViewController {
} }
var areaPoints: [CLLocationCoordinate2D] = [] var areaPoints: [CLLocationCoordinate2D] = []
if remove == true {
updateEditAreaFill(points: areaPoints, remove: remove)
updateEditAreaAddSymbol(points: areaPoints, remove: remove)
} else {
if area.points.count >= 3 { if area.points.count >= 3 {
areaPoints = area.points areaPoints = area.points
areaPoints.append(area.points[0]) areaPoints.append(area.points[0])
updateEditAreaFill(points: areaPoints, remove: true) updateEditAreaFill(points: areaPoints, remove: true)
updateEditAreaFill(points: areaPoints, remove: false) updateEditAreaFill(points: areaPoints, remove: false)
updateEditAreaAddSymbol(points: areaPoints, remove: false)
var isAddSymbol = false
if area.points.count >= ngaAreaPointMax {
isAddSymbol = true
} }
updateEditAreaAddSymbol(points: areaPoints, remove: isAddSymbol)
} }
} }
} }
......
...@@ -14,12 +14,10 @@ class GetNgaList { ...@@ -14,12 +14,10 @@ class GetNgaList {
var sessionNgaList = SessionNgaList() var sessionNgaList = SessionNgaList()
func start() { func start() {
print(debug: "called")
sessionNgaList.RequestGetNgaList(responseGetNgaList) sessionNgaList.RequestGetNgaList(responseGetNgaList)
} }
private func responseGetNgaList(result: Result<Data, APIError>) { private func responseGetNgaList(result: Result<Data, APIError>) {
print(debug: "called")
switch result { switch result {
case .success(let resultData): case .success(let resultData):
let serverSession = ServerSession() let serverSession = ServerSession()
......
...@@ -71,9 +71,13 @@ class NotificationTags: NSObject { ...@@ -71,9 +71,13 @@ class NotificationTags: NSObject {
let chatTag = "chat-" + shipId let chatTag = "chat-" + shipId
let emergencyTag = "emergency-" + shipId let emergencyTag = "emergency-" + shipId
if Preferences.ChatNotification == false {
MSNotificationHub.addTags([routeTag, bamTag, taskAlertTag, sailassistTag, emergencyTag])
} else {
MSNotificationHub.addTags([routeTag, bamTag, taskAlertTag, sailassistTag, emergencyTag, chatTag]) MSNotificationHub.addTags([routeTag, bamTag, taskAlertTag, sailassistTag, emergencyTag, chatTag])
} }
} }
}
} }
var connection: HubConnection? var connection: HubConnection?
...@@ -331,28 +335,18 @@ extension AppDelegate: UNUserNotificationCenterDelegate { ...@@ -331,28 +335,18 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
let strTitle = arrAlert["title"] as? String ?? "" //船名 let strTitle = arrAlert["title"] as? String ?? "" //船名
let strBody = arrAlert["body"] as? String ?? "" //送信内容 let strBody = arrAlert["body"] as? String ?? "" //送信内容
print(debug: "called \(subtitle) \(strTitle) \(strBody)") // print(debug: "called \(subtitle) \(strTitle) \(strBody)")
if strTitle == "Chat Warning" { if strTitle == "Chat Warning" {
if SharingData.message.mode { if SharingData.message.mode {
let message = GetMessage()
message.start()
return return
} }
} }
let message = GetMessage()
message.start()
//送信先名称が同一の場合は通知を出さない //送信先名称が同一の場合は通知を出さない
if subtitle == Preferences.UserName { if subtitle == Preferences.UserName {
return return
} }
//チャット通知OFF
if Preferences.ChatNotification == false {
return
}
case "sailassist": case "sailassist":
print(debug: "sailassist") print(debug: "sailassist")
SharingData.pushHistory.viewCnt += 1 SharingData.pushHistory.viewCnt += 1
...@@ -385,7 +379,6 @@ extension AppDelegate: UNUserNotificationCenterDelegate { ...@@ -385,7 +379,6 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
didReceive response: UNNotificationResponse, didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) { withCompletionHandler completionHandler: @escaping () -> Void) {
let userInfo = response.notification.request.content.userInfo let userInfo = response.notification.request.content.userInfo
print(debug: userInfo)
if !userInfo.isEmpty { if !userInfo.isEmpty {
guard let arrAPS = userInfo["aps"] as? [String: Any] else { guard let arrAPS = userInfo["aps"] as? [String: Any] else {
completionHandler() completionHandler()
...@@ -403,15 +396,7 @@ extension AppDelegate: UNUserNotificationCenterDelegate { ...@@ -403,15 +396,7 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
let strTitle = arrAlert["title"] as? String ?? "" //船名 let strTitle = arrAlert["title"] as? String ?? "" //船名
let strBody = arrAlert["body"] as? String ?? "" //送信先名称 let strBody = arrAlert["body"] as? String ?? "" //送信先名称
print(debug: "called \(subtitle) \(strTitle) \(strBody)") // print(debug: "called \(subtitle) \(strTitle) \(strBody)")
let message = GetMessage()
message.start()
//チャット通知OFF
if Preferences.ChatNotification == false {
return
}
case "sailassist": case "sailassist":
print(debug: "sailassist") print(debug: "sailassist")
SharingData.pushHistory.viewCnt += 1 SharingData.pushHistory.viewCnt += 1
......
...@@ -20,7 +20,6 @@ class SessionNgaList : ObservableObject { ...@@ -20,7 +20,6 @@ class SessionNgaList : ObservableObject {
* タスクリスト取得 * タスクリスト取得
*/ */
func RequestGetNgaList(_ completion: @escaping ((Result<Data, APIError>)) -> Void) { func RequestGetNgaList(_ completion: @escaping ((Result<Data, APIError>)) -> Void) {
print(debug: "calld")
if Calling { if Calling {
return return
} }
...@@ -44,7 +43,6 @@ class SessionNgaList : ObservableObject { ...@@ -44,7 +43,6 @@ class SessionNgaList : ObservableObject {
* タスク保存 * タスク保存
*/ */
func RequestPostNgaList(_ nga : ReqNgaList, completion: @escaping ((Result<Data, APIError>)) -> Void) { func RequestPostNgaList(_ nga : ReqNgaList, completion: @escaping ((Result<Data, APIError>)) -> Void) {
print(debug: "calld")
if Calling { if Calling {
return return
} }
......
...@@ -20,7 +20,6 @@ class SessionShipStatus : ObservableObject { ...@@ -20,7 +20,6 @@ class SessionShipStatus : ObservableObject {
* 船情報 * 船情報
*/ */
func RequestShipStatus(_ completion: @escaping ((Result<Data, APIError>)) -> Void) { func RequestShipStatus(_ completion: @escaping ((Result<Data, APIError>)) -> Void) {
print(debug: "calld")
if Calling { if Calling {
return return
} }
......
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