diff --git a/public/offline.html b/public/offline.html new file mode 100644 index 0000000..6b2c8c1 --- /dev/null +++ b/public/offline.html @@ -0,0 +1,50 @@ + + +
+ + +به نظر میرسد به اینترنت وصل نیستید. اتصال خود را بررسی کنید و دوباره تلاش کنید.
+ + + diff --git a/public/service-worker.js b/public/service-worker.js index ff777cb..2a172c4 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -43,10 +43,11 @@ self.addEventListener("notificationclick", (event) => { ); }); -const CACHE_NAME = "pwa-cache-v11"; +const CACHE_NAME = "pwa-cache-v12"; const PRECACHE_URLS = [ "/", + "/offline.html", "/manifest.webmanifest", "/manifest.json", "/images/icons/192x192.png", @@ -82,7 +83,9 @@ self.addEventListener("fetch", (event) => { const url = new URL(event.request.url); if (event.request.mode === "navigate") { - event.respondWith(fetch(event.request)); + event.respondWith( + fetch(event.request).catch(() => caches.match("/offline.html")) + ); return; } diff --git a/src/app/(projects)/academy/[id]/[title]/CourseClient.tsx b/src/app/(projects)/academy/[id]/[title]/CourseClient.tsx index ac39a17..2eddca2 100644 --- a/src/app/(projects)/academy/[id]/[title]/CourseClient.tsx +++ b/src/app/(projects)/academy/[id]/[title]/CourseClient.tsx @@ -655,6 +655,7 @@ useEffect(() => { key={selectedVideo?._id || ""} className="w-full aspect-video" controls + playsInline controlsList="nodownload noplaybackrate" onContextMenu={preventDownload} onKeyDown={preventDownload} diff --git a/src/app/about-us/page.tsx b/src/app/about-us/page.tsx index 6e29c34..7c9b7b0 100644 --- a/src/app/about-us/page.tsx +++ b/src/app/about-us/page.tsx @@ -5,9 +5,17 @@ import RoundedDiv from "@/components/elements/RoundedDiv"; import EditPageHeader from "@/components/settings/EditPageHeader"; import Link from "next/link"; import { useTranslation } from "react-i18next"; +import { isAndroidDevice } from "@/lib/pwa/install"; +import { buildStorageUrl } from "@/components/main/BaseUrl"; +import { ANDROID_APP_VERSION } from "@/lib/pwaConfig"; + +// عین PwaInstallPrompt.tsx: مسیر مستقیمِ فایل APK که بکاند بدون روتِ جدید سرو میکنه +const ANDROID_APK_URL = buildStorageUrl("/downloads/modstagram.apk"); function AboutUs() { const { t } = useTranslation("common"); + // فقط اندروید — طبق خواستهی صریح کاربر توی iOS این دکمه نمایش داده نشه + const isAndroid = isAndroidDevice(); return (