|
|
@@ -110,20 +110,25 @@ function getUser() { |
|
|
|
|
|
|
|
return getAvatar(token) |
|
|
|
}).then(b => { |
|
|
|
if (!b) return // Exit if token is invalid |
|
|
|
const validTypes = ['image/jpeg', 'image/png'] |
|
|
|
|
|
|
|
if (!b || !validTypes.includes(b.type) || b.size <= 1) { |
|
|
|
return fetch("/assets/image/default-avatar.jpg"). |
|
|
|
fetch("/assets/image/default-avatar.jpg"). |
|
|
|
then(r => r.blob()).then( a => this.user.avatar = a ) |
|
|
|
} else { |
|
|
|
this.user.avatar = b |
|
|
|
} |
|
|
|
|
|
|
|
this.user.avatar = b |
|
|
|
return getLetterhead(token) |
|
|
|
}).then(b => { |
|
|
|
if (!b) return // Exit if token is invalid |
|
|
|
const validTypes = ['image/jpeg', 'image/png'] |
|
|
|
this.user.letterhead = b |
|
|
|
const validTypes = ['image/jpeg', 'image/png'] |
|
|
|
|
|
|
|
if (!b || !validTypes.includes(b.type) || b.size <= 1) { |
|
|
|
fetch("/assets/image/default-avatar.jpg"). |
|
|
|
then(r => r.blob()).then( a => this.user.letterhead = a ) |
|
|
|
} else { |
|
|
|
this.user.letterhead = b |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|