This commit is contained in:
@@ -66,8 +66,8 @@ export function BookmarksClient({ initialSearch = null, initialOpen = null }: {
|
||||
useEffect(() => {
|
||||
const timer = setTimeout(load, search ? 250 : 0)
|
||||
const reload = () => { load(); void loadShared() }
|
||||
window.addEventListener('computer:bookmarks-changed', reload)
|
||||
return () => { clearTimeout(timer); window.removeEventListener('computer:bookmarks-changed', reload); abortRef.current?.abort() }
|
||||
window.addEventListener('superbrain:bookmarks-changed', reload)
|
||||
return () => { clearTimeout(timer); window.removeEventListener('superbrain:bookmarks-changed', reload); abortRef.current?.abort() }
|
||||
}, [load, loadShared, search])
|
||||
useEffect(() => { const timer = setTimeout(loadShared, 0); return () => clearTimeout(timer) }, [loadShared])
|
||||
// Quick Find and the dashboard redirect land here with ?search=; the prop
|
||||
|
||||
@@ -64,7 +64,7 @@ export function CalendarClient() {
|
||||
finally { if (seq === loadSeq.current) setLoading(false) }
|
||||
}, [])
|
||||
|
||||
useEffect(() => { const timer = setTimeout(load, 0); window.addEventListener('computer:bookmarks-changed', load); return () => { clearTimeout(timer); window.removeEventListener('computer:bookmarks-changed', load) } }, [load])
|
||||
useEffect(() => { const timer = setTimeout(load, 0); window.addEventListener('superbrain:bookmarks-changed', load); return () => { clearTimeout(timer); window.removeEventListener('superbrain:bookmarks-changed', load) } }, [load])
|
||||
|
||||
const days = useMemo(() => {
|
||||
const start = startOfMonth(currentMonth)
|
||||
|
||||
@@ -42,7 +42,7 @@ export function ContactsClient() {
|
||||
|
||||
useEffect(() => { const timer = setTimeout(loadContacts, 0); return () => clearTimeout(timer) }, [loadContacts])
|
||||
useEffect(() => { const timer = setTimeout(() => { if (selectedContact) loadBookmarks(selectedContact) }, 0); return () => clearTimeout(timer) }, [selectedContact, loadBookmarks])
|
||||
useEffect(() => { const reload = () => { loadContacts(); if (selectedContact) loadBookmarks(selectedContact) }; window.addEventListener('computer:bookmarks-changed', reload); return () => window.removeEventListener('computer:bookmarks-changed', reload) }, [loadContacts, loadBookmarks, selectedContact])
|
||||
useEffect(() => { const reload = () => { loadContacts(); if (selectedContact) loadBookmarks(selectedContact) }; window.addEventListener('superbrain:bookmarks-changed', reload); return () => window.removeEventListener('superbrain:bookmarks-changed', reload) }, [loadContacts, loadBookmarks, selectedContact])
|
||||
|
||||
const syncContacts = async () => {
|
||||
setSyncing(true)
|
||||
|
||||
@@ -69,7 +69,7 @@ export function KanbanClient() {
|
||||
setLoading(false)
|
||||
}, [])
|
||||
|
||||
useEffect(() => { const timer = setTimeout(load, 0); window.addEventListener('computer:bookmarks-changed', load); return () => { clearTimeout(timer); window.removeEventListener('computer:bookmarks-changed', load) } }, [load])
|
||||
useEffect(() => { const timer = setTimeout(load, 0); window.addEventListener('superbrain:bookmarks-changed', load); return () => { clearTimeout(timer); window.removeEventListener('superbrain:bookmarks-changed', load) } }, [load])
|
||||
|
||||
const isOwned = useCallback((b: Bookmark) => !currentUserId || b.ownerId === currentUserId, [currentUserId])
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ export function TagsClient({ initialTag = null }: { initialTag?: string | null }
|
||||
}, 0)
|
||||
return () => clearTimeout(timer)
|
||||
}, [selectedTag, loadBookmarks])
|
||||
useEffect(() => { const reload = () => { loadTags(); if (selectedTag) loadBookmarks(selectedTag) }; window.addEventListener('computer:bookmarks-changed', reload); return () => window.removeEventListener('computer:bookmarks-changed', reload) }, [loadTags, loadBookmarks, selectedTag])
|
||||
useEffect(() => { const reload = () => { loadTags(); if (selectedTag) loadBookmarks(selectedTag) }; window.addEventListener('superbrain:bookmarks-changed', reload); return () => window.removeEventListener('superbrain:bookmarks-changed', reload) }, [loadTags, loadBookmarks, selectedTag])
|
||||
|
||||
const createTag = async () => {
|
||||
if (!newName) return
|
||||
|
||||
@@ -62,7 +62,7 @@ export function TrashClient() {
|
||||
const url = URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = `computer-export-${new Date().toISOString().slice(0, 10)}.json`
|
||||
a.download = `superbrain-export-${new Date().toISOString().slice(0, 10)}.json`
|
||||
document.body.appendChild(a); a.click(); a.remove()
|
||||
URL.revokeObjectURL(url)
|
||||
toast.success('Export downloaded')
|
||||
|
||||
@@ -55,7 +55,7 @@ async function proxy(request: NextRequest) {
|
||||
// does). X-Forwarded-For is deliberately ignored: its leftmost entry is
|
||||
// client-controlled. backendFetch adds the timestamped HMAC signature.
|
||||
const clientIP = observedClientIP(request.headers)
|
||||
if (clientIP) headers.set('x-computer-client-ip', clientIP)
|
||||
if (clientIP) headers.set('x-superbrain-client-ip', clientIP)
|
||||
if (!['GET', 'HEAD'].includes(request.method)) {
|
||||
const declared = Number(request.headers.get('content-length') || 0)
|
||||
if (declared > MAX_BODY_BYTES) {
|
||||
|
||||
@@ -33,7 +33,7 @@ export async function POST(req: Request) {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
// Same short-lived assertion the data proxy signs (lib/api.ts).
|
||||
Authorization: `Bearer ${jwt.sign({ uid: id, ver, typ: 'assertion' }, secret, { algorithm: 'HS256', issuer: 'computer', expiresIn: '60s' })}`,
|
||||
Authorization: `Bearer ${jwt.sign({ uid: id, ver, typ: 'assertion' }, secret, { algorithm: 'HS256', issuer: 'superbrain', expiresIn: '60s' })}`,
|
||||
},
|
||||
cache: 'no-store',
|
||||
signal: controller.signal,
|
||||
|
||||
+2
-2
@@ -10,14 +10,14 @@ const jetbrainsMono = JetBrains_Mono({ subsets: ['latin'], variable: '--font-mon
|
||||
|
||||
export const metadata = {
|
||||
metadataBase: new URL(process.env.NEXTAUTH_URL ?? 'http://localhost:3000'),
|
||||
title: 'computer',
|
||||
title: 'Superbrain',
|
||||
description: 'Your personal binder of life on the web',
|
||||
icons: {
|
||||
icon: '/favicon.svg',
|
||||
shortcut: '/favicon.svg',
|
||||
},
|
||||
openGraph: {
|
||||
title: 'computer',
|
||||
title: 'Superbrain',
|
||||
description: 'Your personal binder of life on the web',
|
||||
images: ['/og-image.png'],
|
||||
},
|
||||
|
||||
@@ -49,7 +49,7 @@ export function LoginClient({ oidcEnabled }: { oidcEnabled: boolean }) {
|
||||
<Link2 className="h-7 w-7" />
|
||||
</div>
|
||||
</div>
|
||||
<h1 className="font-display text-3xl font-bold tracking-tight">computer</h1>
|
||||
<h1 className="font-display text-3xl font-bold tracking-tight">Superbrain</h1>
|
||||
<p className="text-sm text-muted-foreground mt-2">Your personal binder of life on the web</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ export function PublicBookmarkView({ bookmark }: { bookmark: any }) {
|
||||
<div className="flex h-8 w-8 items-center justify-center rounded-lg bg-primary text-primary-foreground">
|
||||
<Link2 className="h-4 w-4" />
|
||||
</div>
|
||||
<span className="font-display font-bold">computer</span>
|
||||
<span className="font-display font-bold">Superbrain</span>
|
||||
<span className="text-muted-foreground text-sm">— Shared Bookmark</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -57,7 +57,7 @@ export function SignupClient() {
|
||||
</div>
|
||||
</div>
|
||||
<h1 className="font-display text-3xl font-bold tracking-tight">Create Account</h1>
|
||||
<p className="text-sm text-muted-foreground mt-2">Join computer to start organizing your links</p>
|
||||
<p className="text-sm text-muted-foreground mt-2">Join Superbrain to start organizing your links</p>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSignup} className="space-y-3">
|
||||
|
||||
Reference in New Issue
Block a user