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

fix AF-1794
This commit is contained in:
pengx17
2024-11-27 07:00:45 +00:00
parent 6e25243868
commit f2398574ed

View File

@@ -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