Repository navigation
إصلاح: الروابط لا تستجيب بعد كل نشر - #62
Merged
Merged
Conversation
…، فالتبويب الذي ما زال يحمل index.html القديم (فُتح قبل النشر، أو جاء من ذاكرة GitHub Pages لعشر دقائق) يطلب ملفات لم تعد موجودة، فلا يفتح أي مادة أو درس ويظهر 404 في الكونسول. الآن حين يفشل تحميل صفحة يعيد التطبيق تحميل نفسه مرة واحدة على النسخة الجديدة (حارس 30 ثانية يمنع الدوران)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
المشكلة
بعد كل نشر تتغير أسماء ملفات الصفحات (
SubjectView-xxxx.jsوغيرها). التبويب الذي ما زال يحملindex.htmlالقديم، لأنه فُتح قبل النشر أو لأن GitHub Pages يخزّن الصفحة عشر دقائق، يطلب الملفات القديمة فيرد الخادم 404، ولا يفتح أي مادة أو درس حتى يعيد المستخدم التحميل بنفسه.الإصلاح
في
src/main.ts: عند فشل تحميل صفحة (router.onErrorأو حدثvite:preloadError) يعيد التطبيق تحميل نفسه مرة واحدة فيحصل على النسخة الجديدة. حارس 30 ثانية فيsessionStorageيمنع الدوران إذا جاءت الصفحة القديمة مرة أخرى.التحقق
نسخة من البناء حُذف منها ملف
SubjectViewوقُدّمت محليًا، ثم نقرة على مادة في Chrome بلا واجهة: الصفحة أعادت تحميل نفسها وبقي الرابط على المادة نفسها.pnpm buildوpnpm lintيمرّان.