Tweak syncing, fix logo generation
This commit is contained in:
parent
27252f543a
commit
5bd4014d6d
3 changed files with 31 additions and 12 deletions
5
build.sh
5
build.sh
|
|
@ -17,6 +17,11 @@ fi
|
||||||
if [[ $VITE_PLATFORM_LOGO =~ ^https:// ]]; then
|
if [[ $VITE_PLATFORM_LOGO =~ ^https:// ]]; then
|
||||||
curl -fSL "$VITE_PLATFORM_LOGO" -o static/logo.png
|
curl -fSL "$VITE_PLATFORM_LOGO" -o static/logo.png
|
||||||
export VITE_PLATFORM_LOGO=static/logo.png
|
export VITE_PLATFORM_LOGO=static/logo.png
|
||||||
|
|
||||||
|
# @capacitor/assets reads its source logo from assets/, not static/, so
|
||||||
|
# propagate a custom platform logo there too for the native app icon/splash
|
||||||
|
cp "$VITE_PLATFORM_LOGO" assets/logo.png
|
||||||
|
cp "$VITE_PLATFORM_LOGO" assets/logo-dark.png
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Ensure generator uses local path (dotenv may have loaded URL from .env)
|
# Ensure generator uses local path (dotenv may have loaded URL from .env)
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
<link rel="icon" href="/pwa-64x64.png" sizes="64x64" type="image/png" />
|
<link rel="icon" href="/pwa-64x64.png" sizes="64x64" type="image/png" />
|
||||||
<link rel="icon" href="/pwa-192x192.png" sizes="192x192" type="image/png" />
|
<link rel="icon" href="/pwa-192x192.png" sizes="192x192" type="image/png" />
|
||||||
<link rel="icon" href="/pwa-512x512.png" sizes="512x512" type="image/png" />
|
<link rel="icon" href="/pwa-512x512.png" sizes="512x512" type="image/png" />
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon-180x180.png" />
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png" />
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
</head>
|
</head>
|
||||||
<body data-sveltekit-preload-data="hover" data-sveltekit-preload-code="eager">
|
<body data-sveltekit-preload-data="hover" data-sveltekit-preload-code="eager">
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import {page} from "$app/stores"
|
import {page} from "$app/stores"
|
||||||
import type {Unsubscriber} from "svelte/store"
|
import type {Unsubscriber} from "svelte/store"
|
||||||
import {last, call, assoc, WEEK, ago} from "@welshman/lib"
|
import {call, assoc, WEEK, MONTH, ago} from "@welshman/lib"
|
||||||
import {merged} from "@welshman/store"
|
import {merged} from "@welshman/store"
|
||||||
import {
|
import {
|
||||||
getListTags,
|
getListTags,
|
||||||
|
|
@ -79,7 +79,6 @@ const pullOneWithFallback = async (
|
||||||
if (signal.aborted) return
|
if (signal.aborted) return
|
||||||
|
|
||||||
const cachedEvents = repository.query([filter]).filter(isSignedEvent)
|
const cachedEvents = repository.query([filter]).filter(isSignedEvent)
|
||||||
const since = last(cachedEvents.slice(10))?.created_at || 0
|
|
||||||
|
|
||||||
if (onEvent) {
|
if (onEvent) {
|
||||||
for (const event of cachedEvents) {
|
for (const event of cachedEvents) {
|
||||||
|
|
@ -114,7 +113,7 @@ const pullOneWithFallback = async (
|
||||||
// }))
|
// }))
|
||||||
|
|
||||||
if (shouldFallback && !signal.aborted) {
|
if (shouldFallback && !signal.aborted) {
|
||||||
request({relays: [url], signal, autoClose: true, filters: [{since, ...filter}], onEvent})
|
request({relays: [url], signal, autoClose: true, filters: [filter], onEvent})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -289,21 +288,36 @@ const syncUserData = () => {
|
||||||
// Spaces
|
// Spaces
|
||||||
|
|
||||||
const syncSpace = (url: string) => {
|
const syncSpace = (url: string) => {
|
||||||
const since = ago(WEEK)
|
|
||||||
const controller = new AbortController()
|
const controller = new AbortController()
|
||||||
const relayKinds = [RELAY_MEMBERS, RELAY_ROLE]
|
|
||||||
const roomMetaKinds = [ROOM_META, ROOM_ADMINS, ROOM_MEMBERS, LIVEKIT_PARTICIPANTS]
|
|
||||||
const roomDeleteKinds = [ROOM_DELETE, ROOM_JOIN, ROOM_LEAVE]
|
|
||||||
|
|
||||||
|
// Low cardinality we want everything for
|
||||||
pullAndListen({
|
pullAndListen({
|
||||||
url,
|
url,
|
||||||
signal: controller.signal,
|
signal: controller.signal,
|
||||||
filters: [
|
filters: [
|
||||||
{kinds: [...relayKinds, ...roomMetaKinds, ...roomDeleteKinds, ...CONTENT_KINDS, MESSAGE]},
|
{kinds: [RELAY_MEMBERS, RELAY_ROLE]},
|
||||||
{kinds: [APP_DATA], "#d": [FEATURED_CONTENT_D]},
|
{kinds: [APP_DATA], "#d": [FEATURED_CONTENT_D]},
|
||||||
{kinds: [BOARD, PIN]},
|
],
|
||||||
{kinds: [...REACTION_KINDS, POLL_RESPONSE], since},
|
})
|
||||||
makeCommentFilter(CONTENT_KINDS, {since}),
|
|
||||||
|
// Higher cardinality stuff we want as much as we can get
|
||||||
|
pullAndListen({
|
||||||
|
url,
|
||||||
|
signal: controller.signal,
|
||||||
|
filters: [
|
||||||
|
{kinds: [ROOM_META, ROOM_ADMINS, ROOM_MEMBERS, ROOM_DELETE, LIVEKIT_PARTICIPANTS, BOARD]},
|
||||||
|
{kinds: [APP_DATA], "#d": [FEATURED_CONTENT_D]},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
// Recent stuff, best effort
|
||||||
|
pullAndListen({
|
||||||
|
url,
|
||||||
|
signal: controller.signal,
|
||||||
|
filters: [
|
||||||
|
{kinds: [...CONTENT_KINDS, MESSAGE, PIN, ROOM_JOIN, ROOM_LEAVE], since: ago(MONTH)},
|
||||||
|
{kinds: [...REACTION_KINDS, POLL_RESPONSE], since: ago(WEEK)},
|
||||||
|
makeCommentFilter(CONTENT_KINDS, {since: ago(WEEK)}),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue