SOURCE / PINNED RELEASE
Made of little things.
Nappakura
- Release
- a75ca0f8b596…
- Author-recorded commit
- 4463126213fa…
- License
- LICENSE
- Author’s source reference
- nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-8db03001b62
Archive hash verified: b448d77b767ae754…. 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 function setupPreferences(
apply: (values: Record<string, unknown>) => void,
) {
if (!runtimeHasDomain('config')) return;
void (async () => {
if (!config.schema)
await config.registerSchema(
settingsSchema as Parameters<typeof config.registerSchema>[0],
);
const subscription = config.subscribe(apply);
window.addEventListener('pagehide', () => subscription.close(), {
once: true,
});
})().catch(() => {
/* Optional host preferences retain app defaults when unavailable. */
});
}
