Skip to content

Conversation

chohongm
Copy link
Contributor

@chohongm chohongm commented Aug 1, 2024

Fixes CLNP-4063

Changelogs

  • Fixed a bug where markdown messages are incorrectly displayed in channel preview
Screenshot 2024-08-05 at 12 34 49 PM

Disabled

Screenshot 2024-08-01 at 3 16 11 PM Screenshot 2024-08-01 at 3 19 25 PM

Enabled

Screenshot 2024-08-01 at 3 10 04 PM Screenshot 2024-08-01 at 3 19 33 PM

@chohongm chohongm self-assigned this Aug 1, 2024
Copy link

netlify bot commented Aug 1, 2024

Deploy Preview for sendbird-uikit-react ready!

Name Link
🔨 Latest commit 3fd28ec
🔍 Latest deploy log https://app.netlify.com/sites/sendbird-uikit-react/deploys/66c5aa0cfb1642000834d6ad
😎 Deploy Preview https://deploy-preview-1187--sendbird-uikit-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add unit tests for the newly added ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added unit tests @AhyoungRyu

@chohongm chohongm force-pushed the fix/CLNP-4063-fix-markdown-message-in-channel-preview branch from 3c10f9f to 1000c09 Compare August 14, 2024 08:46
Copy link
Contributor

@HoonBaek HoonBaek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

};

export const getLastMessage = (channel?: GroupChannel, stringSet = LabelStringSet) => channel?.lastMessage ? getPrettyLastMessage(channel?.lastMessage, stringSet) : '';
export const getLastMessage = (channel?: GroupChannel, stringSet = LabelStringSet) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이전에는 stringSet을 params로 넣는 방식을 택했었는데, 이제는 LocalizationContext에서 직접 가져오는 것도 괜찮을 것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { stringSet } = useLocalization();
을 함수 안에 추가하는 방향일까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getLastMessage 는 현재 쓰이고 있는 곳들이 많아서 나중에 따로 보면 좋을것 같습니다

const { dateLocale, stringSet } = useLocalization();
const { isMobile } = useMediaQueryContext();
const isMentionEnabled = config.groupChannel.enableMention;
const lastMessage = getLastMessage(channel, stringSet);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getLastMessage의 이름을 보면 return값이 BaseMessage 등의 메시지 일 것 같은데
실제로는 string값이네요 좀 더 나은 이름이 있을까요? ex. getLastMessageText

@chohongm chohongm merged commit 35d4d20 into main Aug 21, 2024
4 checks passed
@chohongm chohongm deleted the fix/CLNP-4063-fix-markdown-message-in-channel-preview branch August 21, 2024 08:51
@HoonBaek HoonBaek added v3.15.0 and removed 3.14.15 labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants