From f14e1fefcf18438bd59eb86d625b8c5a6fb3ffc5 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Fri, 20 Dec 2024 13:56:32 -0500 Subject: [PATCH] fix: AppES PD alert This happened because the return signature of get_app_icon was changed so that the MIME type can be returned when the uploaded or default icon is being used as a fallback. AppES was not updated to account for this change. --- src/backend/src/om/entitystorage/AppES.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/src/om/entitystorage/AppES.js b/src/backend/src/om/entitystorage/AppES.js index ab9ce952d..5689190ca 100644 --- a/src/backend/src/om/entitystorage/AppES.js +++ b/src/backend/src/om/entitystorage/AppES.js @@ -289,13 +289,13 @@ class AppES extends BaseES { console.log('GOING TO'); const svc_appIcon = this.context.get('services').get('app-icon'); try { - const stream = await svc_appIcon.get_icon_stream({ + const { stream, mime } = await svc_appIcon.get_icon_stream({ app_uid: await entity.get('uid'), size: icon_size, }); if ( ! stream ) throw Error('no stream'); const buffer = await stream_to_buffer(stream); - const data_url = `data:image/png;base64,${buffer.toString('base64')}`; + const data_url = `data:${mime};base64,${buffer.toString('base64')}`; await entity.set('icon', data_url); console.log('DID IT') } catch (e) {