From cd11300f8f9e8786a3fe284d7985e9d8aef692c1 Mon Sep 17 00:00:00 2001 From: "68893236+KINDNICK@users.noreply.github.com" <68893236+KINDNICK@users.noreply.github.com> Date: Wed, 18 Mar 2026 01:28:30 +0900 Subject: [PATCH] =?UTF-8?q?Remove:=20=EC=BA=98=EB=A6=B0=EB=8D=94=20?= =?UTF-8?q?=EC=BA=90=EC=8B=B1=20=EC=A0=9C=EA=B1=B0,=20=EB=A7=A4=EB=B2=88?= =?UTF-8?q?=20=EC=B5=9C=EC=8B=A0=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=B6=88?= =?UTF-8?q?=EB=9F=AC=EC=98=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- js/schedule.js | 54 +++++++------------------------------------------- 1 file changed, 7 insertions(+), 47 deletions(-) diff --git a/js/schedule.js b/js/schedule.js index 6d31e94..55735be 100644 --- a/js/schedule.js +++ b/js/schedule.js @@ -6,7 +6,6 @@ 'use strict'; var APPS_SCRIPT_URL = 'https://script.google.com/macros/s/AKfycbwoaoSmEskbJod4gR5NjLnpWSkhIDUYaGBYk0y1Q865TzaJ4gctSrTOWXxRnVa7J9AASA/exec'; - var CACHE_TTL = 30 * 60 * 1000; // 30분 var currentYear, currentMonth; var calTitle = document.getElementById('calTitle'); @@ -35,20 +34,13 @@ function renderCalendar() { updateTitle(); - var cached = getCache(currentYear, currentMonth); - if (cached !== null) { - buildGrid(cached); - } else { - // 즉시 빈 그리드 렌더링 + 로딩 표시 - buildGrid([]); - showLoading(); - fetchBookedDates(currentYear, currentMonth, function(dates) { - setCache(currentYear, currentMonth, dates); - buildGrid(dates); - hideLoading(); - prefetchAdjacent(); - }); - } + // 매번 새로 불러오기 + buildGrid([]); + showLoading(); + fetchBookedDates(currentYear, currentMonth, function(dates) { + buildGrid(dates); + hideLoading(); + }); } function showLoading() { @@ -72,38 +64,6 @@ if (overlay) overlay.remove(); } - function prefetchAdjacent() { - var nextM = currentMonth + 1, nextY = currentYear; - if (nextM > 12) { nextM = 1; nextY++; } - if (getCache(nextY, nextM) === null) { - fetchBookedDates(nextY, nextM, function(dates) { - setCache(nextY, nextM, dates); - }); - } - } - - // --- localStorage 캐싱 --- - function cacheKey(y, m) { return 'mingle_cal_' + y + '_' + m; } - - function getCache(y, m) { - try { - var raw = localStorage.getItem(cacheKey(y, m)); - if (!raw) return null; - var obj = JSON.parse(raw); - if (Date.now() - obj.ts > CACHE_TTL) { - localStorage.removeItem(cacheKey(y, m)); - return null; - } - return obj.dates; - } catch (e) { return null; } - } - - function setCache(y, m, dates) { - try { - localStorage.setItem(cacheKey(y, m), JSON.stringify({ dates: dates, ts: Date.now() })); - } catch (e) { /* quota exceeded 등 무시 */ } - } - // --- 제목 업데이트 --- function updateTitle() { var lang = (window.i18n && window.i18n.currentLang) || 'ko';