Fix error when opening an empty note

This commit is contained in:
Gamebrary 2021-01-10 11:01:49 -07:00
parent 8fdbc66649
commit 9689b9d3b7

View file

@ -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() {