Skip to content

Commit

Permalink
[#112] Do not display "You are in this timezone"
Browse files Browse the repository at this point in the history
Problem: We received some feedback that showing "You are in this
timezone" in ephemeral messages isn't very useful. It would be better to
just display the converted time, like we do for all other ephemeral
messages, for consitency.

Solution: display the converted time.
  • Loading branch information
dcastro committed Sep 7, 2023
1 parent 57077ca commit 281e137
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/TzBot/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ renderOnSuccess (ModalFlag forModal) sender timeRef timeRefSucess user = do
let isNotSender = ((/=) `on` uId) sender user
shouldShowThisConversion = isNotSender || forModal
guard shouldShowThisConversion
Just "You are in this timezone"
Just renderedUserTime
totalClockChanges = checkForClockChanges timeRef timeRefSucess userTzLabel
mbClockChangeWarning = do
guard $ not $ null totalClockChanges
Expand Down
4 changes: 2 additions & 2 deletions test/Test/TzBot/RenderSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test_renderSpec = TestGroup "Render"
mkChatCase arbitraryTime1 "10am" userMoscow userMoscow2
[ convertWithoutNotes
"\"10am\", 30 January 2023 in Europe/Moscow"
"You are in this timezone"
"10:00, Monday, 30 January 2023 in your timezone (Europe/Moscow)"
]
, testCase "Back to author, same timezone" $
mkChatCase arbitraryTime1 "10am" userMoscow userMoscow
Expand Down Expand Up @@ -161,7 +161,7 @@ test_renderSpec = TestGroup "Render"
mkModalCase arbitraryTime1 "10am" userMoscow userMoscow
[ convertWithoutNotes
"\"10am\", 30 January 2023 in Europe/Moscow"
"You are in this timezone"
"10:00, Monday, 30 January 2023 in your timezone (Europe/Moscow)"
]
]

Expand Down

0 comments on commit 281e137

Please sign in to comment.