Fix error when opts is null/undefined

This commit is contained in:
Lim Chee Aun 2023-09-03 19:44:26 +08:00
parent 6c3a700f01
commit c5766e431c

View file

@ -5,7 +5,7 @@ export default function openCompose(opts) {
const top = Math.max(0, (screenHeight - 450) / 2); const top = Math.max(0, (screenHeight - 450) / 2);
const width = Math.min(screenWidth, 600); const width = Math.min(screenWidth, 600);
const height = Math.min(screenHeight, 450); const height = Math.min(screenHeight, 450);
const winUID = opts.uid || Math.random(); const winUID = opts?.uid || Math.random();
const newWin = window.open( const newWin = window.open(
url, url,
'compose' + winUID, 'compose' + winUID,