Skip to content

Commit 3bca274

Browse files
committed
fix: prod builkd break as ? is not supported
1 parent a94944e commit 3bca274

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,8 @@ function RemoteFunctions(config = {}) {
15851585

15861586
// 4. Check overlap with other box (if it exists)
15871587
if (boxType === 'info-box' && _nodeMoreOptionsBox) {
1588-
const optionsBoxElement = _nodeMoreOptionsBox._shadow?.querySelector('.phoenix-more-options-box');
1588+
const optionsBoxElement = _nodeMoreOptionsBox._shadow &&
1589+
_nodeMoreOptionsBox._shadow.querySelector('.phoenix-more-options-box');
15891590
if (optionsBoxElement) {
15901591
const optionsBoxBounds = optionsBoxElement.getBoundingClientRect();
15911592
const optionsBoxRect = _coordsToRect(
@@ -1601,7 +1602,8 @@ function RemoteFunctions(config = {}) {
16011602
}
16021603
}
16031604
} else if (boxType === 'options-box' && _nodeInfoBox) {
1604-
const infoBoxElement = _nodeInfoBox._shadow?.querySelector('.phoenix-node-info-box');
1605+
const infoBoxElement = _nodeInfoBox._shadow &&
1606+
_nodeInfoBox._shadow.querySelector('.phoenix-node-info-box');
16051607
if (infoBoxElement) {
16061608
const infoBoxBounds = infoBoxElement.getBoundingClientRect();
16071609
const infoBoxRect = _coordsToRect(
@@ -1636,7 +1638,8 @@ function RemoteFunctions(config = {}) {
16361638

16371639
// Get the box element to determine dimensions
16381640
const boxSelector = boxType === 'info-box' ? '.phoenix-node-info-box' : '.phoenix-more-options-box';
1639-
const boxElement = boxInstance._shadow?.querySelector(boxSelector);
1641+
const boxElement = boxInstance._shadow &&
1642+
boxInstance._shadow.querySelector(boxSelector);
16401643

16411644
if (!boxElement) {
16421645
return fallbackPos;

src/extensionsIntegrated/phoenix-pro/LivePreviewEdit.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,9 @@ define(function (require, exports, module) {
399399
if (!message.selection || message.selection.startOffset >= message.selection.endOffset) {
400400
return;
401401
}
402+
const endOffset = textNodeMap[textNodeMap.length - 1] && textNodeMap[textNodeMap.length - 1].endOffset;
402403

403-
if (message.selection.endOffset > textNodeMap[textNodeMap.length - 1]?.endOffset) {
404+
if (message.selection.endOffset > endOffset) {
404405
return;
405406
}
406407

0 commit comments

Comments
 (0)