OverviewFilesCommitsIssuesDocsReleasesPeers

apds commits / 628406e

standardize on bogbot.get api
628406eafec7c5f5e8a54764456428a474a1891f
by Ev Bogue <ev@evbogue.com> · 2025-01-04T21:44:04.000Z

Changed files (3) +8 -8

bogbot.js +2 -2
……@@ -36,7 +36,7 @@ bogbot.start = async (appId) => {
3636 await Promise.all(log.map(async (hash) => {
3737 const obj = {
3838 hash,
39 sig: await bogbot.find(hash)
39 sig: await bogbot.get(hash)
4040 }
4141 obj.opened = await bogbot.open(obj.sig)
4242 obj.ts = obj.opened.substring(0, 13)
……@@ -161,7 +161,7 @@ bogbot.make = async (data) => {
161161 return hash
162162}
163163
164bogbot.find = async (hash) => {
164bogbot.get = async (hash) => {
165165 const blob = await db.get(hash)
166166
167167 return blob
profile.js +3 -3
……@@ -6,9 +6,9 @@ export const profile = async () => {
66
77 const avatarImg = await bogbot.visual(await bogbot.pubkey())
88
9 const existingImage = await bogbot.find('image')
9 const existingImage = await bogbot.get('image')
1010
11 if (existingImage) { avatarImg.src = await bogbot.find(existingImage)}
11 if (existingImage) { avatarImg.src = await bogbot.get(existingImage)}
1212
1313 avatarImg.style = 'height: 30px; width: 30px; float: left; margin-right: 5px; object-fit: cover;'
1414
……@@ -67,7 +67,7 @@ export const profile = async () => {
6767
6868 div.appendChild(h('div', [await bogbot.pubkey()]))
6969
70 const name = await bogbot.find('name')
70 const name = await bogbot.get('name')
7171
7272 const namer = h('input', {
7373 placeholder: name || 'Name yourself'
render.js +3 -3
……@@ -22,7 +22,7 @@ render.blob = async (blob) => {
2222 div.appendChild(h('a', {href: '#' + blob.substring(0, 44), id: 'name'}, [blob.substring(0, 10)]))
2323 div.appendChild(h('a', {href: '#' + hash, style: 'float: right;'}, [ts]))
2424 div.appendChild(h('div', {id: opened.substring(13)}))
25 const content = await bogbot.find(opened.substring(13))
25 const content = await bogbot.get(opened.substring(13))
2626 if (content) {
2727 await render.blob(content)
2828 }
……@@ -39,7 +39,7 @@ render.blob = async (blob) => {
3939 node.textContent = yaml.name
4040 }
4141 if (yaml.image && node.id === 'image') {
42 const image = await bogbot.find(yaml.image)
42 const image = await bogbot.get(yaml.image)
4343 node.src = image
4444 }
4545 })
……@@ -53,7 +53,7 @@ render.hash = async (hash, scroller) => {
5353
5454 scroller.insertBefore(div, scroller.firstChild)
5555
56 const sig = await bogbot.find(hash)
56 const sig = await bogbot.get(hash)
5757
5858 if (sig) {
5959 await render.blob(sig)