Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions src/components/browser/BrowserWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1174,16 +1174,31 @@ export const BrowserWindow = () => {
undefined,
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) {
console.error("Error during child selector caching:", error);
} finally {
setIsCachingChildSelectors(false);

if (pendingNotification) {
notify(pendingNotification.type, pendingNotification.message);
setPendingNotification(null);
}
}
}, 100);
} else {
Expand Down Expand Up @@ -1710,16 +1725,17 @@ export const BrowserWindow = () => {
let cleanedSelector = highlighterData.selector;

setListSelector(cleanedSelector);
notify(
`info`,
t(
setPendingNotification({
type: `info`,
message: t(
"browser_window.attribute_modal.notifications.list_select_success",
{
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());
setFields({});

Expand Down