Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: GitLab merge request images and videos load in private projects #18793

ClosedRasalas(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/18793/headopened View on GitHub

Showing 26 changed files with 30 additions and 8 deletions (loading 23).

x
0 of 26 viewed, 26 left
6 additions and 5 deletionsapps/mobile/src/features/pull-requests/PullRequestDescription.tsxModified
View file
@@ -15,7 +15,7 @@
import { useAppearancePreferences } from "../settings/appearance/AppearancePreferencesProvider";
import type { FilePreviewItem } from "../../components/FilePreviewModal";
import { isBotBadgeImage } from "./botBadgeImages";
-import { PullRequestMarkdown } from "./PullRequestMarkdown";
+import { PullRequestMarkdown, usePullRequestMarkdownText } from "./PullRequestMarkdown";
import { pullRequestDescriptionContent } from "./pullRequestDescriptionContent";
​
const COLLAPSED_HEIGHT = 240;
@@ -31,14 +31,15 @@
const mediaContext = useContext(PullRequestMediaContext);
const { themeVariables: colors } = useAppearancePreferences();
const fadeColor = colors[Platform.OS === "android" ? "--color-sheet-solid" : "--color-screen"];
+ const markdown = usePullRequestMarkdownText(props.markdown);
const content = useMemo(() => {
- const document = parseMarkdownDocument(props.markdown);
- const content = pullRequestDescriptionContent(document, splitPullRequestBody(props.markdown));
+ const document = parseMarkdownDocument(markdown);
+ const content = pullRequestDescriptionContent(document, splitPullRequestBody(markdown));
return {
...content,
attachments: content.attachments.filter((attachment) => !isBotBadgeImage(attachment.uri)),
};
- }, [props.markdown]);
+ }, [markdown]);
const gallery = useMemo<FilePreviewItem[]>(
() =>
content.attachments