small fixes

This commit is contained in:
zadam 2022-12-22 23:11:12 +01:00
parent 46f40ee534
commit 29713de6cd
3 changed files with 4 additions and 4 deletions

View File

@ -63,8 +63,6 @@ class Attribute extends AbstractEntity {
} }
init() { init() {
this.validate();
if (this.attributeId) { if (this.attributeId) {
this.becca.attributes[this.attributeId] = this; this.becca.attributes[this.attributeId] = this;
} }

View File

@ -49,7 +49,7 @@ function updateNoteAttribute(req) {
} }
} }
else { else {
if (body.type === 'relation' && !body.value.trim()) { if (body.type === 'relation' && !body.value?.trim()) {
return {}; return {};
} }
@ -68,6 +68,8 @@ function updateNoteAttribute(req) {
attribute.markAsDeleted(); attribute.markAsDeleted();
} }
console.log(attribute);
attribute.save(); attribute.save();
return { return {

View File

@ -209,7 +209,7 @@ function createLauncher({parentNoteId, launcherType, id}) {
function resetLauncher(noteId) { function resetLauncher(noteId) {
const note = becca.getNote(noteId); const note = becca.getNote(noteId);
if (note.isLauncherConfig()) { if (note.isLaunchBarConfig()) {
if (note) { if (note) {
if (noteId === '_lbRoot') { if (noteId === '_lbRoot') {
// deleting hoisted notes are not allowed, so we just reset the children // deleting hoisted notes are not allowed, so we just reset the children