tangled
alpha
login
or
join now
evbogue.com
/
wiredove
1
fork
atom
a demonstration replicated social networking web app built with anproto
wiredove.net/
social
ed25519
protocols
1
fork
atom
overview
issues
pulls
pipelines
add a sync button that might be fun to press sometimes
Everett Bogue
4 months ago
3cd7d5be
6a037c33
+31
1 changed file
expand all
collapse all
unified
split
navbar.js
+31
navbar.js
···
3
3
import { imageSpan } from './profile.js'
4
4
import { apds } from 'apds'
5
5
import { composer } from './composer.js'
6
6
+
import { sendWs } from './websocket.js'
6
7
7
8
const composeButton = async () => {
8
9
if (await apds.pubkey()) {
···
31
32
}
32
33
})
33
34
35
35
+
const sync = h('a', {
36
36
+
style: 'float: right; margin-top: 3px;',
37
37
+
classList: 'material-symbols-outlined',
38
38
+
onclick: async (e) => {
39
39
+
const log = await apds.query()
40
40
+
console.log(log)
41
41
+
if (log) {
42
42
+
const ar = []
43
43
+
for (const msg of log) {
44
44
+
sendWs(msg.sig)
45
45
+
if (msg.text) {
46
46
+
sendWs(msg.text)
47
47
+
const yaml = await apds.parseYaml(msg.text)
48
48
+
if (yaml.image && !ar.includes(yaml.image)) {
49
49
+
const get = await apds.get(yaml.image)
50
50
+
if (get) {
51
51
+
sendWs(get)
52
52
+
ar.push(yaml.image)
53
53
+
}
54
54
+
}
55
55
+
}
56
56
+
if (!msg.text) {
57
57
+
const get = await apds.get(msg.opened.substring(13))
58
58
+
if (get) {sendWs(get)}
59
59
+
}
60
60
+
}
61
61
+
}}
62
62
+
}, ['Autorenew'])
63
63
+
34
64
export const navbar = async () => {
35
65
const span = h('span', {style: 'margin-left: 5px; float: right;'})
36
66
···
44
74
span,
45
75
' ',
46
76
h('a', {href: '#settings', classList: 'material-symbols-outlined', style: 'float: right; margin-top: 3px;'}, ['Settings']),
77
77
+
sync,
47
78
h('a', {href: 'https://github.com/evbogue/wiredove', classList: 'material-symbols-outlined', style: 'float: right; margin-right: 5px; margin-top: 3px;'}, ['Folder_Data']),
48
79
searchInput,
49
80
]