Merge pull request #878 from getmaxun/caplist-fail

fix: broken capture list failure mechanism
This commit is contained in:
Karishma Shukla
2025-11-12 21:55:07 +05:30
committed by GitHub

View File

@@ -1164,16 +1164,31 @@ export const BrowserWindow = () => {
undefined, undefined,
false false
); );
if (pendingNotification) {
notify(pendingNotification.type, pendingNotification.message);
setPendingNotification(null);
}
} else {
console.warn(`Failed to extract any fields from list selector: ${listSelector}`);
setListSelector(null);
setFields({});
setCachedListSelector(null);
setCachedChildSelectors([]);
setCurrentListId(null);
setInitialAutoFieldIds(new Set());
setPendingNotification(null);
notify(
"error",
"The list you have selected is not valid. Please reselect it."
);
} }
} catch (error) { } catch (error) {
console.error("Error during child selector caching:", error); console.error("Error during child selector caching:", error);
} finally { } finally {
setIsCachingChildSelectors(false); setIsCachingChildSelectors(false);
if (pendingNotification) {
notify(pendingNotification.type, pendingNotification.message);
setPendingNotification(null);
}
} }
}, 100); }, 100);
} else { } else {
@@ -1665,16 +1680,17 @@ export const BrowserWindow = () => {
let cleanedSelector = highlighterData.selector; let cleanedSelector = highlighterData.selector;
setListSelector(cleanedSelector); setListSelector(cleanedSelector);
notify( setPendingNotification({
`info`, type: `info`,
t( message: t(
"browser_window.attribute_modal.notifications.list_select_success", "browser_window.attribute_modal.notifications.list_select_success",
{ {
count: highlighterData.groupInfo.groupSize, count: highlighterData.groupInfo.groupSize,
} }
) || ) ||
`Selected group with ${highlighterData.groupInfo.groupSize} similar elements` `Selected group with ${highlighterData.groupInfo.groupSize} similar elements`,
); count: highlighterData.groupInfo.groupSize,
});
setCurrentListId(Date.now()); setCurrentListId(Date.now());
setFields({}); setFields({});