-
Notifications
You must be signed in to change notification settings - Fork 268
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
Feature/JS-5752: Url preview logic #1065
base: main
Are you sure you want to change the base?
Conversation
@@ -87,7 +88,7 @@ const ChatAttachment = observer(class ChatAttachment extends React.Component<Pro | |||
}; | |||
|
|||
case I.ObjectLayout.Bookmark: { | |||
content = this.renderBookmark(); | |||
content = bookmarkAsDefault ? this.renderDefault() : this.renderBookmark(); |
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.
Do not understand how this should work
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.
i pass bookmarkAsDefault=true in case there are more than 1 attachment in the message and for all attachments in the message form
window.setTimeout(() => { | ||
for (const url of urls) { | ||
const { from, to, isLocal, value } = url; | ||
const param = isLocal ? `file://${value}` : value; | ||
|
||
this.marks = Mark.adjust(this.marks, from - 1, value.length + 1); | ||
this.marks.push({ type: I.MarkType.Link, range: { from, to }, param}); | ||
this.addBookmark(param, true); | ||
}; | ||
this.updateMarkup(text, this.range.to + 1, this.range.to + 1); | ||
}, 150); |
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.
setTimeout? Looks like workaround.
Description
What type of PR is this? (check all applicable)
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?