mirror of
https://github.com/romancm/gamebrary
synced 2024-11-15 15:57:59 +00:00
Fix error when opening an empty note
This commit is contained in:
parent
8fdbc66649
commit
9689b9d3b7
1 changed files with 5 additions and 4 deletions
|
@ -95,10 +95,11 @@ export default {
|
|||
|
||||
const { id } = this.game;
|
||||
|
||||
// TODO: use optional chaining
|
||||
this.localNote = this.notes[id] && typeof this.notes[id] === 'object' && this.notes[id].text
|
||||
? this.notes[id].text
|
||||
: JSON.parse(JSON.stringify(this.notes[id]));
|
||||
if (this.notes[id]) {
|
||||
this.localNote = typeof this.notes[id] === 'object' && this.notes[id].text
|
||||
? this.notes[id].text
|
||||
: JSON.parse(JSON.stringify(this.notes[id]));
|
||||
}
|
||||
},
|
||||
|
||||
async saveNote() {
|
||||
|
|
Loading…
Reference in a new issue