a ton more refactoring

This commit is contained in:
or-else
2021-08-07 15:34:22 -07:00
parent 6d4ff9d625
commit fcb61dcc3b
27 changed files with 1173 additions and 928 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ export const MIME_EXTENSIONS = ['jpg', 'gif', 'png',
// Get an URL from a theCard photo: either create a data: URL or return reference URL.
export function makeImageUrl(photo) {
if (typeof photo == 'object') {
if (photo && typeof photo == 'object') {
if (photo.data && photo.type) {
const mime = photo.type.startsWith('image/') ? photo.type : ('image/' + photo.type);
return 'data:' + mime + ';base64,' + photo.data;