v4.0.8: nginx no-cache·deck-favorites shim으로 배포/캐시 문제 수정
구 HTML·CDN immutable JS가 init 없이 남던 문제를 nginx 캐시 정책·shim·배포 검증으로 해결한다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
22
script/deck-favorites-shim.js
Normal file
22
script/deck-favorites-shim.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* 구 CDN 캐시 deck-favorites.js(init 없음) 호환 — init/forget 폴리해
|
||||
*/
|
||||
(function applyDeckFavoritesShim() {
|
||||
const F = window.UaDeckFavorites;
|
||||
if (!F) return;
|
||||
|
||||
if (typeof F.init !== 'function') {
|
||||
F.init = async function initLegacyShim() {
|
||||
/* localStorage 전용 구버전 — 계정 동기화 없음 */
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof F.forget !== 'function') {
|
||||
F.forget = function forgetLegacyShim(shareCode) {
|
||||
if (!shareCode || typeof F.isFavorite !== 'function') return;
|
||||
if (F.isFavorite(shareCode) && typeof F.toggle === 'function') {
|
||||
F.toggle(shareCode);
|
||||
}
|
||||
};
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user