a tiny oauth browser client for atproto using a service worker
11
fork

Configure Feed

Select the types of activity you want to include in your feed.

attempt -> attempts

+8 -8
+4 -4
atsw.js
··· 145 145 const req = indexedDB.open(DB_NAME, DB_VERSION); 146 146 req.onupgradeneeded = () => { 147 147 const db = req.result; 148 - if (!db.objectStoreNames.contains("attempt")) db.createObjectStore("attempt", { keyPath: "state" }); 148 + if (!db.objectStoreNames.contains("attempts")) db.createObjectStore("attempts", { keyPath: "state" }); 149 149 150 150 if (db.objectStoreNames.contains("sessions")) db.deleteObjectStore("sessions"); 151 151 const ssns = db.createObjectStore("sessions", { keyPath: "did" }); ··· 178 178 } 179 179 180 180 /** @param {AttemptSession} v */ 181 - const putAttempt = (v) => idb("readwrite", "attempt", (s) => s.put(v)); 181 + const putAttempt = (v) => idb("readwrite", "attempts", (s) => s.put(v)); 182 182 183 183 /** @param {string} state @returns {Promise<AttemptSession | undefined>} */ 184 - const getAttempt = (state) => idb("readonly", "attempt", (s) => s.get(state)); 184 + const getAttempt = (state) => idb("readonly", "attempts", (s) => s.get(state)); 185 185 186 186 /** @param {string} state */ 187 - const deleteAttempt = (state) => idb("readwrite", "attempt", (s) => s.delete(state)); 187 + const deleteAttempt = (state) => idb("readwrite", "attempts", (s) => s.delete(state)); 188 188 189 189 /** @param {OAuthSession} v */ 190 190 const putSession = (v) => idb("readwrite", "sessions", (s) => s.put(v));
+4 -4
example/atsw.js
··· 145 145 const req = indexedDB.open(DB_NAME, DB_VERSION); 146 146 req.onupgradeneeded = () => { 147 147 const db = req.result; 148 - if (!db.objectStoreNames.contains("attempt")) db.createObjectStore("attempt", { keyPath: "state" }); 148 + if (!db.objectStoreNames.contains("attempts")) db.createObjectStore("attempts", { keyPath: "state" }); 149 149 150 150 if (db.objectStoreNames.contains("sessions")) db.deleteObjectStore("sessions"); 151 151 const ssns = db.createObjectStore("sessions", { keyPath: "did" }); ··· 178 178 } 179 179 180 180 /** @param {AttemptSession} v */ 181 - const putAttempt = (v) => idb("readwrite", "attempt", (s) => s.put(v)); 181 + const putAttempt = (v) => idb("readwrite", "attempts", (s) => s.put(v)); 182 182 183 183 /** @param {string} state @returns {Promise<AttemptSession | undefined>} */ 184 - const getAttempt = (state) => idb("readonly", "attempt", (s) => s.get(state)); 184 + const getAttempt = (state) => idb("readonly", "attempts", (s) => s.get(state)); 185 185 186 186 /** @param {string} state */ 187 - const deleteAttempt = (state) => idb("readwrite", "attempt", (s) => s.delete(state)); 187 + const deleteAttempt = (state) => idb("readwrite", "attempts", (s) => s.delete(state)); 188 188 189 189 /** @param {OAuthSession} v */ 190 190 const putSession = (v) => idb("readwrite", "sessions", (s) => s.put(v));