MCPcopy Create free account
hub / github.com/Bistutu/FluentRead / cleaner

Function cleaner

entrypoints/utils/cache.ts:59–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57
58 // 24h 清理一次缓存(每次页面打开即 main.js 时都应该调用)
59 cleaner() {
60 const lastSessionTimestamp = localStorage.getItem('flLastSessionTimestamp');
61 const currentTime = Date.now();
62
63 if (!lastSessionTimestamp || currentTime - parseInt(lastSessionTimestamp) > 24 * 3600000) {
64 this.clean();
65 localStorage.setItem('flLastSessionTimestamp', currentTime.toString());
66 }
67 },
68
69 // 清除当前 url.host 的翻译缓存
70 clean() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected