Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

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

pengx17f2398574eda2
diff --git a/packages/frontend/apps/electron/src/main/windows-manager/tab-views.ts b/packages/frontend/apps/electron/src/main/windows-manager/tab-views.ts
index a224f8fbbd..86b387db33 100644
--- a/packages/frontend/apps/electron/src/main/windows-manager/tab-views.ts
+++ b/packages/frontend/apps/electron/src/main/windows-manager/tab-views.ts
@@ -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