This build was committed by a bot.

This commit is contained in:
github-actions[bot]
2026-09-18 18:52:27 +00:00
parent 081074a2df
commit d3e56d2b88
3 changed files with 34 additions and 29 deletions

View File

@@ -2168,40 +2168,44 @@ el.htmlTab_index.textContent = "index.html";
el.htmlTab_extension.textContent = "extension.html";
el.htmlTab_index.onclick = () => showHtmlTab("index");
el.htmlTab_extension.onclick = () => showHtmlTab("extension");
var pullThreads = async () => {
var pullThreads = async (invalidateAll = false) => {
const u = el.threadRepoInput.value.trim();
if (!u.startsWith("gh://")) return;
const info = parseGhUrl(u);
try {
const items = await ghApi(`${info.apiPath}?ref=${info.branch}`);
if (!items) {
THREAD.list = [];
await THREAD.save();
} else {
THREAD.list = items.map((i) => {
if (i.type === "dir") return {
id: i.name,
title: i.name,
type: "folder",
updatedAt: 0
};
if (i.type === "file" && i.name.endsWith(".md")) return {
id: i.path,
title: i.name,
type: "file",
updatedAt: 0
};
const d = deserializeThreadName(i.name);
return d ? {
...d,
status: "synced"
} : null;
}).filter(Boolean);
await THREAD.save();
const local = await localforage.getItem("rem_index_" + u.substring(5)) || [];
const remote = (items || []).map((i) => {
if (i.type === "dir") return {
id: i.name,
title: i.name,
type: "folder",
updatedAt: 0
};
if (i.type === "file" && i.name.endsWith(".md")) return {
id: i.path,
title: i.name,
type: "file",
updatedAt: 0
};
const d = deserializeThreadName(i.name);
return d ? {
...d,
status: "synced"
} : null;
}).filter(Boolean);
for (const t of invalidateAll ? [...local, ...remote] : local) {
if (t.type !== "thread") continue;
const next = remote.find((r) => r.type === "thread" && r.id === t.id);
if (invalidateAll || t.status !== "synced" || !next || next.updatedAt > t.updatedAt) await localforage.removeItem("rem_t_" + t.id);
}
THREAD.list = remote;
await THREAD.save();
await renderThreads();
return true;
} catch (e) {
console.error("Auto-pull failed:", e);
return false;
}
};
$(el.threadRepoInput).on("change", async () => {
@@ -2301,8 +2305,9 @@ $(el.threadSyncBtn).on("click", async () => {
THREAD.list = THREAD.list.filter((x) => !toRemove.includes(x.id));
await THREAD.save();
alert("Pushed to GitHub.");
} else {
await pullThreads();
} else if (await pullThreads(true)) {
state.currentThreadId = null;
clearChat();
alert("Pulled from GitHub.");
}
await renderThreads();

2
dist/index.html vendored
View File

@@ -13,7 +13,7 @@
<script defer src="//unpkg.com/alpinejs"></script>
<script type="module" crossorigin src="/assets/index-CWYcSOgO.js"></script>
<script type="module" crossorigin src="/assets/index-BqgZBjfh.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DUC1RW1F.css">
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
<body class="bg-white text-gray-900 selection:bg-black/10" x-data @click.window="if($event.target.closest('button')) haptic(); if(!document.getElementById('threadPopover').contains($event.target)&&!$event.target.closest('[data-thread-menu]')) hideThreadPopover(); if(!document.getElementById('sunePopover').contains($event.target)&&!$event.target.closest('[data-sune-menu]')) hideSunePopover(); if(!document.getElementById('userMenu').contains($event.target)&&!document.getElementById('userMenuBtn').contains($event.target)) document.getElementById('userMenu').classList.add('hidden')">

2
dist/sw.js vendored
View File

@@ -1 +1 @@
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didnt register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const c=e=>i(e,t),l={module:{uri:t},exports:o,require:c};s[t]=Promise.all(n.map(e=>l[e]||c(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"f8c767b8fe6e11fa13e704d51b97ffbc"},{url:"assets/index-DUC1RW1F.css",revision:null},{url:"assets/index-CWYcSOgO.js",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});
if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didnt register its module`);return e}));self.define=(n,r)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(s[t])return;let o={};const l=e=>i(e,t),c={module:{uri:t},exports:o,require:l};s[t]=Promise.all(n.map(e=>c[e]||l(e))).then(e=>(r(...e),o))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"f47c1e8b7a8062c7e3289f887383a9fa"},{url:"assets/index-DUC1RW1F.css",revision:null},{url:"assets/index-BqgZBjfh.js",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});