Make sure the mail preview grid is there before using it

This commit is contained in:
Hadi Nategh 2023-03-03 11:05:34 +01:00
parent c485a287bb
commit 0e27bb843c

View File

@ -1105,7 +1105,7 @@ app.classes.mail = AppJS.extend(
data.attachmentsBlockTitle = _data.length > 1 ? `+${_data.length-1}` : ''; data.attachmentsBlockTitle = _data.length > 1 ? `+${_data.length-1}` : '';
// Update client cache to avoid resolving winmail.dat attachment again // Update client cache to avoid resolving winmail.dat attachment again
egw.dataStoreUID(data.uid, data); egw.dataStoreUID(data.uid, data);
if (!egwIsMobile()) mailPreview.set_value({content:data}); if (!egwIsMobile() && mailPreview) mailPreview.set_value({content:data});
} }
else else
{ {
@ -1187,7 +1187,7 @@ app.classes.mail = AppJS.extend(
sel_options.attachmentsBlock.actions = actions; sel_options.attachmentsBlock.actions = actions;
} }
if (!egwIsMobile()) mailPreview.set_value({content:data, sel_options:sel_options}); if (!egwIsMobile() && mailPreview) mailPreview.set_value({content:data, sel_options:sel_options});
if (selected && selected.length>1) if (selected && selected.length>1)
{ {