chore: lint

This commit is contained in:
karishmas6
2024-08-21 23:38:33 +05:30
parent a5db763295
commit dde5509ea5

View File

@@ -120,7 +120,7 @@ export const BrowserWindow = () => {
const canvasRect = canvasRef.current.getBoundingClientRect(); const canvasRect = canvasRef.current.getBoundingClientRect();
const clickX = e.clientX - canvasRect.left; const clickX = e.clientX - canvasRect.left;
const clickY = e.clientY - canvasRect.top; const clickY = e.clientY - canvasRect.top;
const highlightRect = highlighterData.rect; const highlightRect = highlighterData.rect;
if ( if (
clickX >= highlightRect.left && clickX >= highlightRect.left &&
@@ -129,15 +129,15 @@ export const BrowserWindow = () => {
clickY <= highlightRect.bottom clickY <= highlightRect.bottom
) { ) {
const options = getAttributeOptions(highlighterData.elementInfo?.tagName || '', highlighterData.elementInfo); const options = getAttributeOptions(highlighterData.elementInfo?.tagName || '', highlighterData.elementInfo);
if (getText === true) { if (getText === true) {
if (options.length === 1) { if (options.length === 1) {
// Directly use the available attribute if only one option is present // Directly use the available attribute if only one option is present
const attribute = options[0].value; const attribute = options[0].value;
const data = attribute === 'href' ? highlighterData.elementInfo?.url || '' : const data = attribute === 'href' ? highlighterData.elementInfo?.url || '' :
attribute === 'src' ? highlighterData.elementInfo?.imageUrl || '' : attribute === 'src' ? highlighterData.elementInfo?.imageUrl || '' :
highlighterData.elementInfo?.innerText || ''; highlighterData.elementInfo?.innerText || '';
addTextStep('', data, { addTextStep('', data, {
selector: highlighterData.selector, selector: highlighterData.selector,
tag: highlighterData.elementInfo?.tagName, tag: highlighterData.elementInfo?.tagName,
@@ -153,7 +153,7 @@ export const BrowserWindow = () => {
setShowAttributeModal(true); setShowAttributeModal(true);
} }
} }
if (getList === true && !listSelector) { if (getList === true && !listSelector) {
setListSelector(highlighterData.selector); setListSelector(highlighterData.selector);
} else if (getList === true && listSelector) { } else if (getList === true && listSelector) {
@@ -171,7 +171,7 @@ export const BrowserWindow = () => {
attribute attribute
} }
}; };
setFields(prevFields => { setFields(prevFields => {
const updatedFields = { const updatedFields = {
...prevFields, ...prevFields,
@@ -179,7 +179,7 @@ export const BrowserWindow = () => {
}; };
return updatedFields; return updatedFields;
}); });
if (listSelector) { if (listSelector) {
addListStep(listSelector, { ...fields, [newField.label]: newField }); addListStep(listSelector, { ...fields, [newField.label]: newField });
} }
@@ -196,7 +196,7 @@ export const BrowserWindow = () => {
} }
} }
}; };
const handleAttributeSelection = (attribute: string) => { const handleAttributeSelection = (attribute: string) => {
if (selectedElement) { if (selectedElement) {