Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(pr): authenticate Azure DevOps attachment previews #21829

Closed4dwaffle(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/21829/headopened View on GitHub

Showing 25 changed files with 39 additions and 16 deletions (loading 22).

x
0 of 25 viewed, 25 left
9 additions and 5 deletionsapps/mobile/src/features/pull-requests/PullRequestMarkdown.tsxModified
View file
@@ -28,6 +28,7 @@
import { SelectableMarkdownText } from "../../native/SelectableMarkdownText";
import { useMarkdownPreviewStyles } from "../files/FileMarkdownPreview";
import { markdownImageSources } from "../../lib/markdownImageSources";
+import { normalizeNativeMarkdownUrl } from "../../lib/markdownLinks";
import { FilePreviewGallery, useFilePreviewGallery } from "../../components/ui/FilePreviewGallery";
import { pullRequestImageSource } from "./pullRequestMediaSource";
import {
@@ -83,20 +84,21 @@
readonly alt: string | null;
readonly onPreview: (source: FilePreviewSource) => void;
}) {
- const media = usePullRequestMediaUrl(props.href);
+ const href = normalizeNativeMarkdownUrl(props.href);
+ const media = usePullRequestMediaUrl(href);
const context = useContext(PullRequestMediaContext);
const withGallery = useFilePreviewGallery();
return (
<ThreadMarkdownImageView
uri={media.uri}
- sourceKey={props.href}
+ sourceKey={href}
cacheKey={media.cacheKey}
- unavailable={media.unavailable || !/^https?:\/\//i.test(props.href)}
+ unavailable={media.unavailable || !/^https?:\/\//i.test(href)}
alt={props.alt}
onPressPreview={(source) =>
props.onPreview(
withGallery({