Used optional chaining (?.) to simplify the extraction of the zoom level from the scaleMatch array. This avoids the need for an explicit check if scaleMatch is truthy before accessing its second element.
parent
e00b3f58a4
commit
c51f6bf0f2
|
|
@ -267,7 +267,7 @@ onUiLoaded(async () => {
|
|||
imageARPreview.style.transform = "";
|
||||
if (parseFloat(mainTab.style.width) > 865) {
|
||||
const scaleMatch = mainTab.style.transform.match(/scale\(([-+]?[0-9]*\.?[0-9]+)\)/);
|
||||
const zoom = scaleMatch && scaleMatch[1] ? Number(scaleMatch[1]) : 1; // default zoom
|
||||
const zoom = scaleMatch?.[1] ? Number(scaleMatch[1]) : 1; // default zoom
|
||||
imageARPreview.style.transformOrigin = "0 0";
|
||||
imageARPreview.style.transform = `scale(${zoom})`;
|
||||
}
|
||||
|
|
@ -278,7 +278,6 @@ onUiLoaded(async () => {
|
|||
setTimeout(() => { img.style.display = "none"; }, 400);
|
||||
};
|
||||
|
||||
|
||||
const hotkeysConfigOpts = await waitForOpts();
|
||||
|
||||
// Default config
|
||||
|
|
|
|||
Loading…
Reference in New Issue