Skip to content

Commit

Permalink
Merge pull request #16492 from kidroca/kidroca/fix/attachment-downloa…
Browse files Browse the repository at this point in the history
…d-uses-prod

Fix Attachment download links for non-previewable items
  • Loading branch information
mountiny authored Mar 28, 2023
2 parents 3f66c68 + 45f2a19 commit 8ac3824
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ const propTypes = {
onPressOut: PropTypes.func,

/** If a file download is happening */
download: PropTypes.bool,
download: PropTypes.shape({
isDownloading: PropTypes.bool.isRequired,
}),

...anchorForAttachmentsOnlyPropTypes,
};

const defaultProps = {
onPressIn: undefined,
onPressOut: undefined,
download: false,
download: {isDownloading: false},
...anchorForAttachmentsOnlyDefaultProps,
};

Expand Down
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 8ac3824

Please sign in to comment.