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

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

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