Skip to content

Commit

Permalink
Fix AnchorRenderer download link for attachments
Browse files Browse the repository at this point in the history
Attachments should be downloaded from a path relative to the current API root
See: Expensify#16327 (comment)
  • Loading branch information
kidroca committed Mar 24, 2023
1 parent 1de4021 commit 474d5ed
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import AnchorForCommentsOnly from '../../AnchorForCommentsOnly';
import AnchorForAttachmentsOnly from '../../AnchorForAttachmentsOnly';
import * as Url from '../../../libs/Url';
import ROUTES from '../../../ROUTES';
import tryResolveUrlFromApiRoot from '../../../libs/tryResolveUrlFromApiRoot';

const AnchorRenderer = (props) => {
const htmlAttribs = props.tnode.attributes;
Expand Down Expand Up @@ -77,7 +78,7 @@ const AnchorRenderer = (props) => {
if (isAttachment) {
return (
<AnchorForAttachmentsOnly
source={attrHref}
source={tryResolveUrlFromApiRoot(attrHref)}
displayName={displayName}
/>
);
Expand Down

0 comments on commit 474d5ed

Please sign in to comment.