mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-04 08:38:34 +00:00
fix(electron): should not show context menu if there is no typos (#8895)
fix AF-1794
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user