Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sailassist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
54
Merge Requests
54
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gr-ssv
Sailassist
Commits
b4e5721a
Commit
b4e5721a
authored
Jun 27, 2024
by
shigemi miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notice未読マーク
parent
734b7525
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
6 deletions
+28
-6
NotificationContentView.swift
...ssist/Sailassist/Alert/View/NotificationContentView.swift
+3
-1
ChatView.swift
Seilassist/Sailassist/Chat/ChatView.swift
+3
-3
SailassistApp.swift
Seilassist/Sailassist/SailassistApp.swift
+10
-2
SharingData.swift
Seilassist/Sailassist/SharingData/SharingData.swift
+1
-0
MainTabView.swift
Seilassist/Sailassist/Tab/MainTabView.swift
+11
-0
No files found.
Seilassist/Sailassist/Alert/View/NotificationContentView.swift
View file @
b4e5721a
...
@@ -47,7 +47,9 @@ struct NotificationContentView: View {
...
@@ -47,7 +47,9 @@ struct NotificationContentView: View {
.
font
(
FontStyle
.
SupplementText2
.
font
)
.
font
(
FontStyle
.
SupplementText2
.
font
)
}
}
.
padding
(
EdgeInsets
(
top
:
17
,
leading
:
30
,
bottom
:
17
,
trailing
:
30
))
.
padding
(
EdgeInsets
(
top
:
17
,
leading
:
30
,
bottom
:
17
,
trailing
:
30
))
.
onAppear
{
SharingData
.
pushHistory
.
viewCnt
=
0
}
}
}
}
}
...
...
Seilassist/Sailassist/Chat/ChatView.swift
View file @
b4e5721a
...
@@ -43,14 +43,14 @@ struct ChatView: View {
...
@@ -43,14 +43,14 @@ struct ChatView: View {
.
onAppear
{
.
onAppear
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
print
(
debug
:
"ChatView:onAppear"
)
print
(
debug
:
"ChatView:onAppear"
)
proxy
.
scrollTo
(
id
,
anchor
:
.
center
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
}
}
}
}
.
onChange
(
of
:
message
.
messages
.
count
)
{
newValue
in
.
onChange
(
of
:
message
.
messages
.
count
)
{
newValue
in
withAnimation
{
withAnimation
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
print
(
debug
:
"ChatView:onChange"
)
print
(
debug
:
"ChatView:onChange"
)
proxy
.
scrollTo
(
id
,
anchor
:
.
center
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
}
}
}
}
}
}
...
@@ -59,7 +59,7 @@ struct ChatView: View {
...
@@ -59,7 +59,7 @@ struct ChatView: View {
guard
!
value
.
isEmpty
else
{
return
}
guard
!
value
.
isEmpty
else
{
return
}
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
if
let
id
=
message
.
messages
.
last
?
.
messageId
{
print
(
debug
:
"ChatView:onReceive"
)
print
(
debug
:
"ChatView:onReceive"
)
proxy
.
scrollTo
(
id
,
anchor
:
.
center
)
proxy
.
scrollTo
(
id
,
anchor
:
.
bottom
)
}
}
}
}
}
}
...
...
Seilassist/Sailassist/SailassistApp.swift
View file @
b4e5721a
...
@@ -331,6 +331,9 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
...
@@ -331,6 +331,9 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
print
(
debug
:
"called
\(
subtitle
)
\(
strTitle
)
\(
strBody
)
"
)
print
(
debug
:
"called
\(
subtitle
)
\(
strTitle
)
\(
strBody
)
"
)
let
message
=
GetMessage
()
message
.
start
()
//送信先名称が同一の場合は通知を出さない
//送信先名称が同一の場合は通知を出さない
if
subtitle
==
Preferences
.
UserName
{
if
subtitle
==
Preferences
.
UserName
{
return
return
...
@@ -382,22 +385,27 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
...
@@ -382,22 +385,27 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
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()
let
message
=
GetMessage
()
message
.
start
()
case
"sailassist"
:
case
"sailassist"
:
print
(
debug
:
"sailassist"
)
print
(
debug
:
"sailassist"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
getPushHistory
.
start
()
case
"bam"
:
case
"bam"
:
print
(
debug
:
"bam"
)
print
(
debug
:
"bam"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
getPushHistory
.
start
()
case
"route"
:
case
"route"
:
print
(
debug
:
"route"
)
print
(
debug
:
"route"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
getPushHistory
.
start
()
case
"emergency"
:
case
"emergency"
:
print
(
debug
:
"emergency"
)
print
(
debug
:
"emergency"
)
SharingData
.
pushHistory
.
viewCnt
+=
1
let
getPushHistory
=
GetPushHistory
()
let
getPushHistory
=
GetPushHistory
()
getPushHistory
.
start
()
getPushHistory
.
start
()
default
:
default
:
...
...
Seilassist/Sailassist/SharingData/SharingData.swift
View file @
b4e5721a
...
@@ -370,6 +370,7 @@ class SharingData{
...
@@ -370,6 +370,7 @@ class SharingData{
class
PushHistory
:
ObservableObject
{
class
PushHistory
:
ObservableObject
{
@Published
var
pushHistoryData
:
Dictionary
<
Int
,
ResPushHistory
>
=
[:]
@Published
var
pushHistoryData
:
Dictionary
<
Int
,
ResPushHistory
>
=
[:]
@Published
var
focusPushHistory
:
Int
?
=
nil
@Published
var
focusPushHistory
:
Int
?
=
nil
@Published
var
viewCnt
:
Int
=
0
//未読数
func
setPushHistory
(
key
:
Int
,
value
:
ResPushHistory
)
{
func
setPushHistory
(
key
:
Int
,
value
:
ResPushHistory
)
{
pushHistoryData
.
updateValue
(
value
,
forKey
:
key
)
pushHistoryData
.
updateValue
(
value
,
forKey
:
key
)
...
...
Seilassist/Sailassist/Tab/MainTabView.swift
View file @
b4e5721a
...
@@ -105,6 +105,7 @@ struct CustomTabBar: View {
...
@@ -105,6 +105,7 @@ struct CustomTabBar: View {
@ObservedObject
var
my
=
SharingData
.
my
@ObservedObject
var
my
=
SharingData
.
my
@ObservedObject
var
message
=
SharingData
.
message
@ObservedObject
var
message
=
SharingData
.
message
@ObservedObject
var
location
=
SharingData
.
location
@ObservedObject
var
location
=
SharingData
.
location
@ObservedObject
var
pushHistory
=
SharingData
.
pushHistory
var
body
:
some
View
{
var
body
:
some
View
{
VStack
(
spacing
:
0
){
VStack
(
spacing
:
0
){
...
@@ -141,6 +142,16 @@ struct CustomTabBar: View {
...
@@ -141,6 +142,16 @@ struct CustomTabBar: View {
.
cornerRadius
(
60
)
.
cornerRadius
(
60
)
}
}
}
}
//チャットTab上の既読マーク
if
tab
==
Tab
.
task
{
if
pushHistory
.
viewCnt
!=
0
{
Rectangle
()
.
foregroundColor
(
.
red
)
.
frame
(
width
:
12
,
height
:
12
)
.
cornerRadius
(
60
)
}
}
}
}
Text
(
tab
.
title
)
Text
(
tab
.
title
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment