Add accounts, presets, live sheet panel and equipment tiles
- Login with registration code, sessions, rate limiting, per-user characters - Share characters with other users (read-only), admin CLI - Rules presets with a Presets tab, applied/pending changes with diff in a side sheet - Equipment as tiles with amounts, starting kit removed - Rename nav tab to "Character", add "New character" button - Stop tracking _to_delete/ Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HJhXuLD2Z6hv3Wqeq9UL9K
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// Characters and presets made before accounts existed were protected by secret keys in this browser.
|
||||
// After login they are handed over to the account once; the old keys are then removed.
|
||||
export async function claimLegacy() {
|
||||
const post = (kind, id, token) =>
|
||||
fetch(`/api/claim/${kind}/${id}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ token }) }).catch(() => null)
|
||||
try {
|
||||
const chars = JSON.parse(localStorage.getItem('aw_chars')) || []
|
||||
for (const c of chars) if (c?.id && c?.token) await post('characters', c.id, c.token)
|
||||
localStorage.removeItem('aw_chars')
|
||||
} catch { /* nothing to claim */ }
|
||||
try {
|
||||
const presets = JSON.parse(localStorage.getItem('aw_presets')) || {}
|
||||
for (const [id, token] of Object.entries(presets)) await post('presets', id, token)
|
||||
localStorage.removeItem('aw_presets')
|
||||
} catch { /* nothing to claim */ }
|
||||
}
|
||||
Reference in New Issue
Block a user