Skip to content

Commit 74999e6

Browse files
committed
feat: support large ics files
1 parent 3260153 commit 74999e6

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/background.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,23 @@ async function handleIcsFetch(url: string) {
3232
const response = await fetch(url);
3333
const data = await response.text();
3434

35-
await browser.storage.local.set({
36-
icsCache: {
37-
...cache,
38-
[url]: {
39-
data,
40-
timestamp: now,
35+
let cached = false;
36+
try {
37+
await browser.storage.local.set({
38+
icsCache: {
39+
...cache,
40+
[url]: {
41+
data,
42+
timestamp: now,
43+
},
4144
},
42-
},
43-
});
45+
});
46+
cached = true;
47+
} catch (storageError) {
48+
console.warn("Failed to cache ICS data", storageError);
49+
}
4450

45-
return { success: true, data, fromCache: false };
51+
return { success: true, data, fromCache: false, cached };
4652
} catch (error) {
4753
return {
4854
success: false,

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const manifest = defineManifest({
77
name: "Google Calendar Tonton",
88
version: "1.3.0",
99
description: "Auto-send Tonton's schedule from Google Calendar.",
10-
permissions: ["storage"],
10+
permissions: ["storage", "unlimitedStorage"],
1111
host_permissions: ["https://calendar.google.com/*"],
1212
action: {
1313
default_icon: {

0 commit comments

Comments
 (0)