edit some in landing page and fix manifest.json

This commit is contained in:
2026-08-18 16:39:00 +03:30
parent c47b03e4f6
commit 2d10c52903
4 changed files with 27 additions and 14 deletions
+5 -12
View File
@@ -1,6 +1,5 @@
import type { AppConfig } from '@/config/types'
import { getConfig, getRawAppConfig } from '@/config/app-config'
import { getConfigUrls, sortConfigUrls } from '@/config/load-config'
import { getRawAppConfig } from '@/config/app-config'
import {
clearCachedPwaManifest,
readCachedPwaManifest,
@@ -39,16 +38,10 @@ export function getConfigBaseFromStorage() {
return normalizeBaseUrl(lastSuccess)
}
function configUrlToManifestUrl(configUrl: string) {
return `${configUrl.replace(/\/+$/, '')}/manifest.json`
}
const PWA_MANIFEST_URL = 'https://nerkh.gold/manifest.json'
/** همان ۵ URL پایهٔ get_user — اولویت با CONFIG_Success_URL */
export function resolveManifestUrls(config?: AppConfig | null): string[] {
const explicit = getConfig<string>('manifest_url')
if (explicit) return [explicit]
return sortConfigUrls(getConfigUrls()).map(configUrlToManifestUrl)
export function resolveManifestUrls(_config?: AppConfig | null): string[] {
return [PWA_MANIFEST_URL]
}
/** اولین کاندید — برای سازگاری */
@@ -518,7 +511,7 @@ async function applyCachedManifestEntry(
/**
* بعد از loadAppConfig / setAppConfig صدا بزن.
* get_user دوباره fetch نمی‌شود — manifest از همان ۵ URL پایهٔ get_user امتحان می‌شود.
* get_user دوباره fetch نمی‌شود — manifest فقط از nerkh.gold گرفته می‌شود.
*/
export async function setupPwaManifest(config?: AppConfig | null): Promise<boolean> {
const raw = config ?? getRawAppConfig()