SOURCE / PINNED RELEASE
Made of little things.
Pünktlich!
- Release
- 9dc6c97948c0…
- Author-recorded commit
- aebcea49a666…
- License
- LICENSE
- Author’s source reference
- nostr://npub1sj2vketepqw9v6fmge5fdzuj7atj9sv6qv2jss05n2z6rl64lcfqumdsnt/wss%3A%2F%2Fgit.napplet.soy%2F/n-bf1ae466031
Archive hash verified: 7705a83d7bdb3f9b…. 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';
// Seconds until the train leaves. Read at the start of each run.
export const settings = { timeLimit: 60 };
if (runtimeHasDomain('config')) {
void (async () => {
if (!config.schema) {
await config.registerSchema(settingsSchema as Parameters<typeof config.registerSchema>[0]);
}
const subscription = config.subscribe((values) => {
const limit = values.timeLimit;
if (typeof limit === 'number' && limit >= 45 && limit <= 90) settings.timeLimit = limit;
});
window.addEventListener('pagehide', () => subscription.close(), { once: true });
})().catch(() => {
// Config is optional; keep the default time limit.
});
}
