Skip to content

Commit 5d02836

Browse files
committed
chore(fc): show success after user report
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent 48de493 commit 5d02836

File tree

4 files changed

+27
-13
lines changed

4 files changed

+27
-13
lines changed

flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/conversation/ConversationViewModel.kt

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import kotlinx.coroutines.flow.onEach
5454
import kotlinx.coroutines.launch
5555
import kotlinx.datetime.Instant
5656
import timber.log.Timber
57+
import xyz.flipchat.app.features.login.register.onResult
5758
import xyz.flipchat.chat.RoomController
5859
import xyz.flipchat.services.domain.model.chat.ConversationMember
5960
import xyz.flipchat.services.domain.model.chat.ConversationMessage
@@ -361,14 +362,25 @@ class ConversationViewModel @Inject constructor(
361362
.filterIsInstance<Event.ReportUser>()
362363
.map { (userId, messageId) ->
363364
roomController.reportUserForMessage(userId, messageId)
364-
}.onError {
365-
TopBarManager.showMessage(
366-
TopBarManager.TopBarMessage(
367-
title = resources.getString(R.string.error_title_failedToReportUserForMessage),
368-
message = resources.getString(R.string.error_description_failedToReportUserForMessage)
365+
}.onResult(
366+
onError = {
367+
TopBarManager.showMessage(
368+
TopBarManager.TopBarMessage(
369+
title = resources.getString(R.string.error_title_failedToReportUserForMessage),
370+
message = resources.getString(R.string.error_description_failedToReportUserForMessage)
371+
)
369372
)
370-
)
371-
}
373+
},
374+
onSuccess = {
375+
TopBarManager.showMessage(
376+
TopBarManager.TopBarMessage(
377+
title = resources.getString(R.string.success_title_reportUser),
378+
message = resources.getString(R.string.success_description_reportUser),
379+
type = TopBarManager.TopBarMessageType.SUCCESS
380+
)
381+
)
382+
}
383+
)
372384
.launchIn(viewModelScope)
373385

374386
eventFlow

flipchatApp/src/main/res/values/strings.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,24 @@
6464
<string name="action_joinRoomByName">Join %1$s</string>
6565

6666
<string name="title_leaveRoom">Leave Room?</string>
67-
<string name="subtitle_leaveRoom">You will need to pay to get back in, but we won\’t tell people you left.</string>
67+
<string name="subtitle_leaveRoom">You will need to pay to get back in, but we won\’t tell people you left</string>
6868
<string name="action_leaveRoomByName">Leave %1$s</string>
6969

7070
<string name="title_deleteMessage">Delete Message?</string>
7171
<string name="subtitle_deleteMessage">Their messages will be deleted for everyone</string>
7272
<string name="action_delete">Delete</string>
7373

7474
<string name="title_removeUserFromRoom">Remove %1$s?</string>
75-
<string name="subtitle_removeUserFromRoom">They will be able to rejoin after waiting an hour, but will have to pay the cover charge again.</string>
75+
<string name="subtitle_removeUserFromRoom">They will be able to rejoin after waiting an hour, but will have to pay the cover charge again</string>
7676
<string name="action_remove">Remove</string>
7777

78-
<string name="title_reportUserForMessage">Report %1$s?</string>
79-
<string name="subtitle_reportUserForMessage">This message will be forwarded to Flipchat. This contact will not be notified.</string>
78+
<string name="title_reportUserForMessage">Report</string>
79+
<string name="subtitle_reportUserForMessage">This message will be forwarded to Flipchat. This contact will not be notified</string>
8080
<string name="action_report">Report</string>
8181

82+
<string name="success_title_reportUser">Report Sent</string>
83+
<string name="success_description_reportUser">Your report was sent successfully</string>
84+
8285
<string name="permissions_description_push_messages">Receive push notifications when people message you.</string>
8386

8487
<string name="action_copyMessage">Copy</string>

ui/components/src/main/kotlin/com/getcode/ui/components/bars/TopBarContainer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private fun TopBarView(
9595
WARNING -> Warning
9696
NOTIFICATION -> TopNotification
9797
NEUTRAL -> TopNeutral
98-
SUCCESS -> TopSuccess
98+
SUCCESS -> CodeTheme.colors.brand
9999

100100
}
101101
)

ui/theme/src/main/kotlin/com/getcode/theme/Color.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ val SystemGreen = Color(0xFF04C759)
3939

4040
val TopNotification = Color(0xFF4f49ce)
4141
val TopNeutral = Color(0xFF747474)
42-
val TopSuccess = Brand
4342

4443
val textSelectionColors = TextSelectionColors(
4544
handleColor = White,

0 commit comments

Comments
 (0)