small refactorings and fixes

This commit is contained in:
zadam
2023-06-29 23:32:19 +02:00
parent 48029cea7c
commit eb34f9c64f
45 changed files with 78 additions and 188 deletions

View File

@@ -111,15 +111,12 @@ export default class ImagePropertiesWidget extends NoteContextAwareWidget {
}
async refreshWithNote(note) {
const attributes = note.getAttributes();
const attributeMap = utils.toObject(attributes, l => [l.name, l.value]);
this.$widget.show();
const blob = await this.note.getBlob();
this.$fileName.text(attributeMap.originalFileName || "?");
this.$fileSize.text(`${blob.contentLength} bytes`);
this.$fileName.text(note.getLabelValue('originalFileName') || "?");
this.$fileSize.text(utils.formatSize(blob.contentLength));
this.$fileType.text(note.mime);
}
}