fix(electron): should not show context menu if there is no typos (#8895)

fix AF-1794
This commit is contained in:
pengx17 committed 2024-11-27 07:00:45 +00:00
1 parent 6e25243868
commit f2398574ed
1 file changed
+6
@@ -836,6 +836,12 @@ export class WebContentViewsManager {
if (spellCheckSettings.enabled) {
view.webContents.on('context-menu', (_event, params) => {
const shouldShow =
params.misspelledWord && params.dictionarySuggestions.length > 0;
if (!shouldShow) {
return;
}
const menu = new Menu();
// Add each spelling suggestion