File tree Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ function useSubtitleArray(convoId?: string) {
47
47
const notification = useSelectedNotificationSetting ( ) ;
48
48
const disappearingMessageSubtitle = useDisappearingMessageSettingText ( {
49
49
convoId,
50
- abbreviate : true ,
51
50
} ) ;
52
51
53
52
const notificationSubtitle = useLocalisedNotificationOf ( notification , 'title' ) ;
Original file line number Diff line number Diff line change @@ -495,13 +495,12 @@ export function useSortedGroupMembers(convoId: string | undefined): Array<Pubkey
495
495
return compact ( members . slice ( ) ?. sort ( ) ) ;
496
496
}
497
497
498
- export function useDisappearingMessageSettingText ( {
499
- convoId,
500
- abbreviate,
501
- } : {
502
- convoId ?: string ;
503
- abbreviate ?: boolean ;
504
- } ) {
498
+ /**
499
+ * Returns the disappearing message setting text for the convoId.
500
+ * Note: the time is not localised and displayed always in its shortened version (i.e. 2weeks -> 2w).
501
+ * This is because 2w is assumed to understood by every locales as 2 weeks, but 2 weeks might not be.
502
+ */
503
+ export function useDisappearingMessageSettingText ( { convoId } : { convoId ?: string } ) {
505
504
const convoProps = useConversationPropsById ( convoId ) ;
506
505
507
506
const offReturn = { id : 'off' , label : localize ( 'off' ) . toString ( ) } ;
@@ -511,11 +510,7 @@ export function useDisappearingMessageSettingText({
511
510
512
511
const { expirationMode, expireTimer } = convoProps ;
513
512
514
- const expireTimerText = isNumber ( expireTimer )
515
- ? abbreviate
516
- ? TimerOptions . getAbbreviated ( expireTimer )
517
- : TimerOptions . getName ( expireTimer )
518
- : null ;
513
+ const expireTimerText = isNumber ( expireTimer ) ? TimerOptions . getAbbreviated ( expireTimer ) : null ;
519
514
520
515
if ( ! expireTimerText ) {
521
516
return offReturn ;
You can’t perform that action at this time.
0 commit comments