Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Joel Oksanen
individual_project
Commits
2d911028
Commit
2d911028
authored
Feb 25, 2020
by
Joel Oksanen
Browse files
Ability to dismiss options
parent
df266b93
Changes
3
Hide whitespace changes
Inline
Side-by-side
ADAbot/ADAbot.xcodeproj/project.xcworkspace/xcuserdata/joeloksanen.xcuserdatad/UserInterfaceState.xcuserstate
View file @
2d911028
No preview for this file type
ADAbot/ADAbot/Chat/ChatManager.swift
View file @
2d911028
...
...
@@ -23,17 +23,21 @@ class ChatManager: ObservableObject {
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.3
)
{
self
.
sent
=
false
self
.
connectionManager
.
addMessage
(
message
:
query
.
message
)
self
.
showingOptionsForMessage
=
nil
self
.
clearOptions
()
}
}
func
showOptionsFor
(
_
message
:
ADAMessage
)
{
showingOptionsForMessage
=
message
showingOptionsForMessage
=
showingOptionsForMessage
==
message
?
nil
:
message
}
func
showingOptionsFor
(
_
message
:
Message
)
->
Bool
{
return
message
is
ADAMessage
&&
(
message
as!
ADAMessage
)
==
showingOptionsForMessage
}
func
clearOptions
()
{
self
.
showingOptionsForMessage
=
nil
}
}
ADAbot/ADAbot/Chat/FeatureView.swift
View file @
2d911028
...
...
@@ -46,7 +46,6 @@ struct FeatureView: View {
}
.
frame
(
maxWidth
:
280
)
.
fixedSize
(
horizontal
:
true
,
vertical
:
false
)
.
zIndex
(
-
1
)
}
.
padding
(
EdgeInsets
(
top
:
0
,
leading
:
0
,
bottom
:
15
,
trailing
:
0
))
}
...
...
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