diff --git a/dist/assets/index-YfnOwjpc.js b/dist/assets/index-BQPvK7LI.js similarity index 99% rename from dist/assets/index-YfnOwjpc.js rename to dist/assets/index-BQPvK7LI.js index f27a6f3..edade14 100644 --- a/dist/assets/index-YfnOwjpc.js +++ b/dist/assets/index-BQPvK7LI.js @@ -1381,7 +1381,7 @@ const ghApi = async (path, method = "GET", body = null) => { const parseGhUrl = (u) => { const p = u.substring(5).split("/"), owner = p[0], repoPart = p[1] || "", branch = repoPart.includes("@") ? repoPart.split("@")[1] : "main", repo = repoPart.split("@")[0], path = p.slice(2).join("/"); const dirPath = path ? path + "/" : ""; - return { owner, repo, branch, path, full: `${owner}/${repo}/contents/${dirPath}index.json?ref=${branch}`, dir: `${owner}/${repo}/contents/${dirPath}` }; + return { owner, repo, branch, path, full: `${owner}/${repo}/contents/${dirPath}index.json?ref=${branch}`, dir: `${owner}/${repo}/contents/${dirPath}index.json?ref=${branch}`.replace("index.json?ref=", "").split("?")[0].split("/").slice(0, -1).join("/") + "/" }; }; $(el.threadRepoInput).on("change", async () => { const u = el.threadRepoInput.value.trim(); @@ -1436,6 +1436,7 @@ $(el.threadSyncBtn).on("click", async () => { } THREAD.list = THREAD.list.filter((x) => !toRemove.includes(x.id)); await ghApi(info.full, "PUT", { message: "Update index.json", content: utob(JSON.stringify(THREAD.list, null, 2)), branch: info.branch, sha }); + await THREAD.save(); alert("Pushed to GitHub."); } else { const idxFile = await ghApi(info.full); diff --git a/dist/index.html b/dist/index.html index c73a72e..4d92e26 100644 --- a/dist/index.html +++ b/dist/index.html @@ -12,7 +12,7 @@ - + diff --git a/dist/sw.js b/dist/sw.js index 9dacbc7..8f1c1c7 100644 --- a/dist/sw.js +++ b/dist/sw.js @@ -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} didn’t 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-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"e77936a1f49cc105f92b52dd1ca398f8"},{url:"assets/index-YfnOwjpc.js",revision:null},{url:"assets/index-JLEDB1oP.css",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} didn’t 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-8c29f6e4"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"53e6b21a560a1889362c3547606c261b"},{url:"assets/index-JLEDB1oP.css",revision:null},{url:"assets/index-BQPvK7LI.js",revision:null},{url:"manifest.webmanifest",revision:"7a6c5c6ab9cb5d3605d21df44c6b17a2"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))});