From 88cfcdb073074b20ba4a032ffc6495b288555462 Mon Sep 17 00:00:00 2001 From: syui Date: Sun, 1 Mar 2026 17:05:31 +0900 Subject: [PATCH] fix social-app patch --- .../046-social-app-ios-null-url-guards.patch | 55 +++++++++++++++++++ ios/setup.zsh | 1 + 2 files changed, 56 insertions(+) create mode 100644 ios/patching/046-social-app-ios-null-url-guards.patch diff --git a/ios/patching/046-social-app-ios-null-url-guards.patch b/ios/patching/046-social-app-ios-null-url-guards.patch new file mode 100644 index 0000000..bb74fbe --- /dev/null +++ b/ios/patching/046-social-app-ios-null-url-guards.patch @@ -0,0 +1,55 @@ +diff --git a/src/features/liveEvents/context.tsx b/src/features/liveEvents/context.tsx +index 3de2534a8..e11955f57 100644 +--- a/src/features/liveEvents/context.tsx ++++ b/src/features/liveEvents/context.tsx +@@ -24,6 +24,7 @@ export const DEFAULT_LIVE_EVENTS = { + + async function fetchLiveEvents(): Promise { + try { ++ if (!LIVE_EVENTS_URL) return null + const res = await fetch(`${LIVE_EVENTS_URL}/config`) + if (!res.ok) return null + const data = await res.json() +diff --git a/src/geolocation/const.ts b/src/geolocation/const.ts +index 653e829ba..4992cc870 100644 +--- a/src/geolocation/const.ts ++++ b/src/geolocation/const.ts +@@ -1,7 +1,9 @@ + import {GEOLOCATION_URL} from '#/env' + import {type Geolocation} from '#/geolocation/types' + +-export const GEOLOCATION_SERVICE_URL = `${GEOLOCATION_URL}/geolocation` ++export const GEOLOCATION_SERVICE_URL = GEOLOCATION_URL ++ ? `${GEOLOCATION_URL}/geolocation` ++ : null + + /** + * Default geolocation config. +diff --git a/src/geolocation/service.ts b/src/geolocation/service.ts +index 2d9285b67..c7c3d02c0 100644 +--- a/src/geolocation/service.ts ++++ b/src/geolocation/service.ts +@@ -26,9 +26,10 @@ const onGeolocationServiceResponseUpdate = ( + } + + async function fetchGeolocationServiceData( +- url: string, ++ url: string | null, + ): Promise { + if (debug.enabled) return debug.resolve(debug.geolocation) ++ if (!url) throw new Error('geolocation service disabled') + const res = await fetch(url) + if (!res.ok) { + throw new Error(`fetchGeolocationServiceData failed ${res.status}`) +diff --git a/src/state/appConfig.tsx b/src/state/appConfig.tsx +index 67b0e553e..9eacf7ead 100644 +--- a/src/state/appConfig.tsx ++++ b/src/state/appConfig.tsx +@@ -30,6 +30,7 @@ let fetchAppConfigPromise: Promise | undefined + + async function fetchAppConfig(): Promise { + try { ++ if (!APP_CONFIG_URL) return null + if (!fetchAppConfigPromise) { + fetchAppConfigPromise = (async () => { + const r = await fetch(`${APP_CONFIG_URL}/config`) diff --git a/ios/setup.zsh b/ios/setup.zsh index 62071d4..c970b1f 100755 --- a/ios/setup.zsh +++ b/ios/setup.zsh @@ -53,6 +53,7 @@ PATCH_FILES_IOS=( "043-social-app-ios-rightnav-links.patch" "044-social-app-ios-splash-video.patch" "045-social-app-ios-composer-cancel.patch" + "046-social-app-ios-null-url-guards.patch" ) function ios-env() {