-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Replace hardcoded strings with MsgType constants #30179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
@@ -302,7 +302,7 @@ export default abstract class Exporter { | |||
} | |||
|
|||
protected isAttachment(mxEv: MatrixEvent): boolean { | |||
const attachmentTypes = ["m.sticker", "m.image", "m.file", "m.video", "m.audio"]; | |||
const attachmentTypes = ["m.sticker", MsgType.Image, MsgType.File, MsgType.Video, MsgType.Audio]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't change "m.sticker"
here because it makes getContext
on the next line angry, and I want to keep my first PR small and light.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
@kenwuuu seems like you have made tests unhappy |
Use constants where possible for maintainability and readability.
Checklist
public
/exported
symbols have accurate TSDoc documentation.