Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
colinvh0 committed Jun 7, 2024
1 parent f2d68c0 commit bbb8f47
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/app/character-editor/character-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { CookieService } from 'ngx-cookie-service';
// TODO: advancement (explicitly buy Build points)
// TODO: fix text knockouts in h4s
// TODO: play/print: adjectives, allegiances
// TODO: mobile
// TODO KC: handle favors/grudges
// TODO KC: square General checkboxes??
// TODO KC: adjectives just a text field?
Expand Down Expand Up @@ -79,9 +80,9 @@ export class CharacterEditorComponent {
loadFromLocal(): void {
let c;
try {
c = localStorage.getItem('char');
c = localStorage.getItem('char'); // TODO: LZString.decompress(...)
} catch (e) {
console.trace(e);
console.trace(e); // TODO: only in dev
}
if (c) {
this.json = c;
Expand Down Expand Up @@ -152,7 +153,9 @@ export class CharacterEditorComponent {

saveToLocal(): void {
if (this.canSave) {
localStorage.setItem('char', this.json);
afterNextRender(() => {
localStorage.setItem('char', this.json); // TODO: LZString.compress(this.json)
}, {phase: AfterRenderPhase.Read});
}
}

Expand Down

0 comments on commit bbb8f47

Please sign in to comment.