Ref: original & and use fileObj.meta

fileObj.meta is part of the ostrio:files API and be passed to the
constructor. This is less hacky than trying tu update a persistet object
after the fact.
This commit is contained in:
David Arnold 2020-09-14 01:07:17 -05:00
parent 6e1dce94f0
commit 00d8d7f9fe
No known key found for this signature in database
GPG key ID: 6D6A936E69C59D08
10 changed files with 127 additions and 164 deletions

View file

@ -51,7 +51,7 @@ template(name="changeAvatarPopup")
unless isSelected
a.js-delete-avatar {{_ 'delete'}}
| -
= original.name
= name
li: a.js-select-initials
.member
+userAvatarInitials(userId=currentUser._id)

View file

@ -102,13 +102,13 @@ BlazeComponent.extendComponent({
},
false,
);
uploader.on('uploaded', (error, fileObj) => {
uploader.on('uploaded', (error, fileRef) => {
if (!error) {
self.setAvatar(fileObj.path);
self.setAvatar(fileRef.path);
// self.setAvatar(this.currentData().url(this.avatarUrlOptions()));
}
});
uploader.on('error', (error, fileObj) => {
uploader.on('error', (error, fileData) => {
// XXX check for actually returned error
self.setError('avatar-too-big');
});