SOURCE / PINNED RELEASE
Made of little things.
Funclet
- Release
- 0b497cfc2f66…
- Author-recorded commit
- 1e531b24f490…
- License
- LICENSE
- Author’s source reference
- nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-6b7a37cac1d
Archive hash verified: 71d97a89ed8c40c2…. The source-to-build association is the author’s claim; it has not been independently rebuilt.
import { config } from '@napplet/sdk';
import { runtimeHasDomain } from './domain-availability.js';
import settingsSchema from '../config.schema.json';
export const preferences = { showArtwork: true, refreshSeconds: 45 };
export async function subscribeSettings(changed: () => void): Promise<{ close(): void } | undefined> {
if (!runtimeHasDomain('config')) return;
try {
if (!config.schema) await config.registerSchema(settingsSchema as Parameters<typeof config.registerSchema>[0]);
return config.subscribe(values => {
preferences.showArtwork = values.showArtwork !== false;
preferences.refreshSeconds = typeof values.refreshSeconds === 'number' ? Math.max(30, Math.min(120, values.refreshSeconds)) : 45;
changed();
});
} catch { return; }
}
