fix: Links to attachments do not work in emailed notifications (#5935)
This commit is contained in:
@@ -249,6 +249,17 @@ const findAndReplaceStyle = () => css`
|
||||
}
|
||||
`;
|
||||
|
||||
const emailStyle = (props: Props) => css`
|
||||
.attachment {
|
||||
display: block;
|
||||
color: ${props.theme.text} !important;
|
||||
box-shadow: 0 0 0 1px ${props.theme.divider};
|
||||
white-space: nowrap;
|
||||
border-radius: 8px;
|
||||
padding: 6px 8px;
|
||||
}
|
||||
`;
|
||||
|
||||
const style = (props: Props) => `
|
||||
flex-grow: ${props.grow ? 1 : 0};
|
||||
justify-content: start;
|
||||
@@ -1546,6 +1557,7 @@ const EditorContainer = styled.div<Props>`
|
||||
${codeMarkCursor}
|
||||
${codeBlockStyle}
|
||||
${findAndReplaceStyle}
|
||||
${emailStyle}
|
||||
`;
|
||||
|
||||
export default EditorContainer;
|
||||
|
||||
@@ -29,6 +29,7 @@ function isAttachment(token: Token) {
|
||||
// external (public share are pre-signed and this is a reasonable way of detecting them)
|
||||
href?.startsWith("/api/attachments.redirect") ||
|
||||
href?.startsWith("/api/files.get") ||
|
||||
href?.startsWith(`${env.URL}/api/files.get`) ||
|
||||
((href?.startsWith(env.AWS_S3_UPLOAD_BUCKET_URL) ||
|
||||
href?.startsWith(env.AWS_S3_ACCELERATE_URL)) &&
|
||||
href?.includes("X-Amz-Signature"))
|
||||
|
||||
Reference in New Issue
Block a user