From f99966bbe68363aeb9f76ef5bb66108fa25f48a4 Mon Sep 17 00:00:00 2001 From: Spotlight Date: Thu, 27 Jan 2022 21:48:39 -0600 Subject: [PATCH 01/18] Use perl to resolve symlinks --- app/static/darwin/github.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/darwin/github.sh b/app/static/darwin/github.sh index ecdcab7f54..8e30c698eb 100755 --- a/app/static/darwin/github.sh +++ b/app/static/darwin/github.sh @@ -2,7 +2,7 @@ # The least terrible way to resolve a symlink to its real path. function realpath() { - /usr/bin/python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; + /usr/bin/perl -e "use Cwd;print Cwd::abs_path(@ARGV[0])" "$0"; } CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")" From e336cf4a71f86c2883fdc324c2f2e59c419378da Mon Sep 17 00:00:00 2001 From: Becca Date: Mon, 31 Jan 2022 08:43:34 -0500 Subject: [PATCH 02/18] Move building spell checker menu to main-process --- app/src/lib/ipc-shared.ts | 3 +- app/src/main-process/main.ts | 21 ++- .../main-process/menu/build-context-menu.ts | 15 +- .../menu/build-spell-check-menu.ts | 112 +++++++++++++++ app/src/ui/main-process-proxy.ts | 129 +----------------- 5 files changed, 149 insertions(+), 131 deletions(-) create mode 100644 app/src/main-process/menu/build-spell-check-menu.ts diff --git a/app/src/lib/ipc-shared.ts b/app/src/lib/ipc-shared.ts index 015bd02adc..1d1d1a774e 100644 --- a/app/src/lib/ipc-shared.ts +++ b/app/src/lib/ipc-shared.ts @@ -85,7 +85,8 @@ export type RequestResponseChannels = { 'get-app-architecture': () => Promise 'move-to-trash': (path: string) => Promise 'show-contextual-menu': ( - items: ReadonlyArray + items: ReadonlyArray, + addSpellCheckMenu: boolean ) => Promise | null> 'is-window-focused': () => Promise 'open-external': (path: string) => Promise diff --git a/app/src/main-process/main.ts b/app/src/main-process/main.ts index f04f38dfbc..5005f836ba 100644 --- a/app/src/main-process/main.ts +++ b/app/src/main-process/main.ts @@ -37,6 +37,7 @@ import { installSameOriginFilter } from './same-origin-filter' import * as ipcMain from './ipc-main' import { getArchitecture } from '../lib/get-architecture' import * as remoteMain from '@electron/remote/main' +import { buildSpellCheckMenu } from './menu/build-spell-check-menu' remoteMain.initialize() app.setAppLogsPath() @@ -450,14 +451,24 @@ app.on('ready', () => { * Handle the action to show a contextual menu. * * It responds an array of indices that maps to the path to reach - * the menu (or submenu) item that was clicked or null if the menu - * was closed without clicking on any item. + * the menu (or submenu) item that was clicked or null if the menu was closed + * without clicking on any item or the item click was handled by the main + * process as opposed to the renderer. */ - ipcMain.handle('show-contextual-menu', (event, items) => { - return new Promise(resolve => { - const menu = buildContextMenu(items, indices => resolve(indices)) + ipcMain.handle('show-contextual-menu', (event, items, addSpellCheckMenu) => { + return new Promise(async resolve => { const window = BrowserWindow.fromWebContents(event.sender) || undefined + const spellCheckMenuItems = addSpellCheckMenu + ? await buildSpellCheckMenu(window) + : undefined + + const menu = buildContextMenu( + items, + indices => resolve(indices), + spellCheckMenuItems + ) + menu.popup({ window, callback: () => resolve(null) }) }) }) diff --git a/app/src/main-process/menu/build-context-menu.ts b/app/src/main-process/menu/build-context-menu.ts index 70a9b31508..0a673a277e 100644 --- a/app/src/main-process/menu/build-context-menu.ts +++ b/app/src/main-process/menu/build-context-menu.ts @@ -48,9 +48,20 @@ function getEditMenuItems(): ReadonlyArray { */ export function buildContextMenu( template: ReadonlyArray, - onClick: (indices: ReadonlyArray) => void + onClick: (indices: ReadonlyArray) => void, + spellCheckMenuItems?: ReadonlyArray ): Menu { - return buildRecursiveContextMenu(template, onClick) + const menu = buildRecursiveContextMenu(template, onClick) + + if (spellCheckMenuItems === undefined) { + return menu + } + + for (const spellCheckMenuItem of spellCheckMenuItems) { + menu.append(spellCheckMenuItem) + } + + return menu } function buildRecursiveContextMenu( diff --git a/app/src/main-process/menu/build-spell-check-menu.ts b/app/src/main-process/menu/build-spell-check-menu.ts new file mode 100644 index 0000000000..fc6d6d225a --- /dev/null +++ b/app/src/main-process/menu/build-spell-check-menu.ts @@ -0,0 +1,112 @@ +import { app, BrowserWindow, MenuItem } from 'electron' + +export async function buildSpellCheckMenu( + window: BrowserWindow | undefined +): Promise | undefined> { + if (window === undefined) { + // window.webContents.off('context-menu', mergeDeferredContextMenuItems) + return + } + + /* + When a user right clicks on a misspelled word in an input, we get event from + electron. That event comes after the context menu event that we get from the + dom. + */ + return new Promise(resolve => { + window.webContents.once('context-menu', (event, params) => + resolve(getSpellCheckMenuItems(event, params, window.webContents)) + ) + }) +} + +function getSpellCheckMenuItems( + event: Electron.Event, + params: Electron.ContextMenuParams, + webContents: Electron.WebContents +): ReadonlyArray | undefined { + const { misspelledWord, dictionarySuggestions } = params + if (!misspelledWord && dictionarySuggestions.length === 0) { + return + } + + const items = new Array() + + items.push( + new MenuItem({ + type: 'separator', + }) + ) + + for (const suggestion of dictionarySuggestions) { + items.push( + new MenuItem({ + label: suggestion, + click: () => webContents.replaceMisspelling(suggestion), + }) + ) + } + + if (misspelledWord) { + items.push( + new MenuItem({ + label: __DARWIN__ ? 'Add to Dictionary' : 'Add to dictionary', + click: () => + webContents.session.addWordToSpellCheckerDictionary(misspelledWord), + }) + ) + } + + if (!__DARWIN__) { + // NOTE: "On macOS as we use the native APIs there is no way to set the + // language that the spellchecker uses" -- electron docs Therefore, we are + // only allowing setting to English for non-mac machines. + const spellCheckLanguageItem = getSpellCheckLanguageMenuItem( + webContents.session + ) + if (spellCheckLanguageItem !== null) { + items.push(spellCheckLanguageItem) + } + } + + return items +} + +/** + * Method to get a menu item to give user the option to use English or their + * system language. + * + * If system language is english, it returns null. If spellchecker is not set to + * english, it returns item that can set it to English. If spellchecker is set + * to english, it returns the item that can set it to their system language. + */ +function getSpellCheckLanguageMenuItem( + session: Electron.session +): MenuItem | null { + const userLanguageCode = app.getLocale() + const englishLanguageCode = 'en-US' + const spellcheckLanguageCodes = session.getSpellCheckerLanguages() + + if ( + userLanguageCode === englishLanguageCode && + spellcheckLanguageCodes.includes(englishLanguageCode) + ) { + return null + } + + const languageCode = + spellcheckLanguageCodes.includes(englishLanguageCode) && + !spellcheckLanguageCodes.includes(userLanguageCode) + ? userLanguageCode + : englishLanguageCode + + const label = + languageCode === englishLanguageCode + ? 'Set spellcheck to English' + : 'Set spellcheck to system language' + + return new MenuItem({ + label, + click: () => session.setSpellCheckerLanguages([languageCode]), + }) +} diff --git a/app/src/ui/main-process-proxy.ts b/app/src/ui/main-process-proxy.ts index 0f2798e2e2..27c8d63739 100644 --- a/app/src/ui/main-process-proxy.ts +++ b/app/src/ui/main-process-proxy.ts @@ -1,4 +1,3 @@ -import * as remote from '@electron/remote' import { ExecutableMenuItem } from '../models/app-menu' import { IMenuItem, ISerializableMenuItem } from '../lib/menu-item' import { RequestResponseChannels, RequestChannels } from '../lib/ipc-shared' @@ -226,133 +225,17 @@ function findSubmenuItem( return foundMenuItem } -let deferredContextMenuItems: ReadonlyArray | null = null - -/** Takes a context menu and spelling suggestions from electron and merges them - * into one context menu. */ -function mergeDeferredContextMenuItems( - event: Electron.Event, - params: Electron.ContextMenuParams -) { - if (deferredContextMenuItems === null) { - return - } - - const items = [...deferredContextMenuItems] - const { misspelledWord, dictionarySuggestions } = params - - if (!misspelledWord && dictionarySuggestions.length === 0) { - showContextualMenu(items, false) - return - } - - items.push({ type: 'separator' }) - - const { webContents } = remote.getCurrentWindow() - - for (const suggestion of dictionarySuggestions) { - items.push({ - label: suggestion, - action: () => webContents.replaceMisspelling(suggestion), - }) - } - - if (misspelledWord) { - items.push({ - label: __DARWIN__ ? 'Add to Dictionary' : 'Add to dictionary', - action: () => - webContents.session.addWordToSpellCheckerDictionary(misspelledWord), - }) - } - - if (!__DARWIN__) { - // NOTE: "On macOS as we use the native APIs there is no way to set the - // language that the spellchecker uses" -- electron docs Therefore, we are - // only allowing setting to English for non-mac machines. - const spellCheckLanguageItem = getSpellCheckLanguageMenuItem( - webContents.session - ) - if (spellCheckLanguageItem !== null) { - items.push(spellCheckLanguageItem) - } - } - - showContextualMenu(items, false) -} - -/** - * Method to get a menu item to give user the option to use English or their - * system language. - * - * If system language is english, it returns null. If spellchecker is not set to - * english, it returns item that can set it to English. If spellchecker is set - * to english, it returns the item that can set it to their system language. - */ -function getSpellCheckLanguageMenuItem( - session: Electron.session -): IMenuItem | null { - const userLanguageCode = remote.app.getLocale() - const englishLanguageCode = 'en-US' - const spellcheckLanguageCodes = session.getSpellCheckerLanguages() - - if ( - userLanguageCode === englishLanguageCode && - spellcheckLanguageCodes.includes(englishLanguageCode) - ) { - return null - } - - const languageCode = - spellcheckLanguageCodes.includes(englishLanguageCode) && - !spellcheckLanguageCodes.includes(userLanguageCode) - ? userLanguageCode - : englishLanguageCode - - const label = - languageCode === englishLanguageCode - ? 'Set spellcheck to English' - : 'Set spellcheck to system language' - - return { - label, - action: () => session.setSpellCheckerLanguages([languageCode]), - } -} - -const _showContextualMenu = invokeProxy('show-contextual-menu', 1) +const _showContextualMenu = invokeProxy('show-contextual-menu', 2) /** Show the given menu items in a contextual menu. */ export async function showContextualMenu( items: ReadonlyArray, - mergeWithSpellcheckSuggestions = false + addSpellCheckMenu = false ) { - /* - When a user right clicks on a misspelled word in an input, we get event from - electron. That event comes after the context menu event that we get from the - dom. In order merge the spelling suggestions from electron with the context - menu that the input wants to show, we stash the context menu items from the - input away while we wait for the event from electron. - */ - if (deferredContextMenuItems !== null) { - deferredContextMenuItems = null - remote - .getCurrentWebContents() - .off('context-menu', mergeDeferredContextMenuItems) - } - - if (mergeWithSpellcheckSuggestions) { - deferredContextMenuItems = items - remote - .getCurrentWebContents() - .once('context-menu', mergeDeferredContextMenuItems) - return - } - - /* - This is a regular context menu that does not need to merge with spellcheck - items. They can be shown right away. - */ - const indices = await _showContextualMenu(serializeMenuItems(items)) + const indices = await _showContextualMenu( + serializeMenuItems(items), + addSpellCheckMenu + ) if (indices !== null) { const menuItem = findSubmenuItem(items, indices) From 5b9861c79c936fd808d952cab651548e88b2966f Mon Sep 17 00:00:00 2001 From: Becca Date: Mon, 31 Jan 2022 08:37:37 -0500 Subject: [PATCH 03/18] Move menu related functions to menu file --- app/src/lib/menu-item.ts | 57 +++++++++++++++++++ .../autocompleting-text-input.tsx | 2 +- app/src/ui/branches/branch-list-item.tsx | 2 +- app/src/ui/changes/changes-list.tsx | 2 +- app/src/ui/changes/commit-message.tsx | 2 +- app/src/ui/diff/side-by-side-diff.tsx | 2 +- app/src/ui/diff/text-diff.tsx | 2 +- app/src/ui/history/commit-list-item.tsx | 2 +- app/src/ui/history/selected-commit.tsx | 2 +- app/src/ui/lib/author-input.tsx | 2 +- app/src/ui/lib/conflicts/unmerged-file.tsx | 2 +- app/src/ui/lib/text-area.tsx | 2 +- app/src/ui/lib/text-box.tsx | 2 +- app/src/ui/main-process-proxy.ts | 56 +----------------- .../repositories-list/repositories-list.tsx | 2 +- .../repository-list-item.tsx | 2 +- 16 files changed, 72 insertions(+), 69 deletions(-) diff --git a/app/src/lib/menu-item.ts b/app/src/lib/menu-item.ts index cd6f5552bc..7d3d97918b 100644 --- a/app/src/lib/menu-item.ts +++ b/app/src/lib/menu-item.ts @@ -1,3 +1,5 @@ +import { invokeContextualMenu } from '../ui/main-process-proxy' + export interface IMenuItem { /** The user-facing label. */ readonly label?: string @@ -72,3 +74,58 @@ export function getPlatformSpecificNameOrSymbolForModifier( // Not a known modifier, likely a normal key return modifier } + +/** Show the given menu items in a contextual menu. */ +export async function showContextualMenu( + items: ReadonlyArray, + addSpellCheckMenu = false +) { + const indices = await invokeContextualMenu( + serializeMenuItems(items), + addSpellCheckMenu + ) + + if (indices !== null) { + const menuItem = findSubmenuItem(items, indices) + + if (menuItem !== undefined && menuItem.action !== undefined) { + menuItem.action() + } + } +} + +/** + * Remove the menu items properties that can't be serializable in + * order to pass them via IPC. + */ +function serializeMenuItems( + items: ReadonlyArray +): ReadonlyArray { + return items.map(item => ({ + ...item, + action: undefined, + submenu: item.submenu ? serializeMenuItems(item.submenu) : undefined, + })) +} + +/** + * Traverse the submenus of the context menu until we find the appropriate index. + */ +function findSubmenuItem( + currentContextualMenuItems: ReadonlyArray, + indices: ReadonlyArray +): IMenuItem | undefined { + let foundMenuItem: IMenuItem | undefined = { + submenu: currentContextualMenuItems, + } + + for (const index of indices) { + if (foundMenuItem === undefined || foundMenuItem.submenu === undefined) { + return undefined + } + + foundMenuItem = foundMenuItem.submenu[index] + } + + return foundMenuItem +} diff --git a/app/src/ui/autocompletion/autocompleting-text-input.tsx b/app/src/ui/autocompletion/autocompleting-text-input.tsx index ddcf99da19..e6cf587781 100644 --- a/app/src/ui/autocompletion/autocompleting-text-input.tsx +++ b/app/src/ui/autocompletion/autocompleting-text-input.tsx @@ -15,7 +15,7 @@ interface IRange { } import getCaretCoordinates from 'textarea-caret' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' interface IAutocompletingTextInputProps { /** diff --git a/app/src/ui/branches/branch-list-item.tsx b/app/src/ui/branches/branch-list-item.tsx index 81ceba6645..b3355227de 100644 --- a/app/src/ui/branches/branch-list-item.tsx +++ b/app/src/ui/branches/branch-list-item.tsx @@ -6,7 +6,7 @@ import { IMatches } from '../../lib/fuzzy-find' import { Octicon } from '../octicons' import * as OcticonSymbol from '../octicons/octicons.generated' import { HighlightText } from '../lib/highlight-text' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' import { IMenuItem } from '../../lib/menu-item' import { dragAndDropManager } from '../../lib/drag-and-drop-manager' import { DragType, DropTargetType } from '../../models/drag-drop' diff --git a/app/src/ui/changes/changes-list.tsx b/app/src/ui/changes/changes-list.tsx index 8b75628977..09357ff568 100644 --- a/app/src/ui/changes/changes-list.tsx +++ b/app/src/ui/changes/changes-list.tsx @@ -27,7 +27,7 @@ import { import { CommitMessage } from './commit-message' import { ChangedFile } from './changed-file' import { IAutocompletionProvider } from '../autocompletion' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' import { arrayEquals } from '../../lib/equality' import { clipboard } from 'electron' import { basename } from 'path' diff --git a/app/src/ui/changes/commit-message.tsx b/app/src/ui/changes/commit-message.tsx index 8eb101f5f0..ad13fe0714 100644 --- a/app/src/ui/changes/commit-message.tsx +++ b/app/src/ui/changes/commit-message.tsx @@ -27,7 +27,7 @@ import { CommitWarning, CommitWarningIcon } from './commit-warning' import { LinkButton } from '../lib/link-button' import { FoldoutType } from '../../lib/app-state' import { IAvatarUser, getAvatarUserFromAuthor } from '../../models/avatar' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' import { Account } from '../../models/account' import { CommitMessageAvatar } from './commit-message-avatar' import { getDotComAPIEndpoint } from '../../lib/api' diff --git a/app/src/ui/diff/side-by-side-diff.tsx b/app/src/ui/diff/side-by-side-diff.tsx index aeaad97855..499d30f8f9 100644 --- a/app/src/ui/diff/side-by-side-diff.tsx +++ b/app/src/ui/diff/side-by-side-diff.tsx @@ -46,7 +46,7 @@ import { getLineWidthFromDigitCount, getNumberOfDigits, } from './diff-helpers' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' import { getTokens } from './diff-syntax-mode' import { DiffSearchInput } from './diff-search-input' import { escapeRegExp } from '../../lib/helpers/regex' diff --git a/app/src/ui/diff/text-diff.tsx b/app/src/ui/diff/text-diff.tsx index 94ece2cd0b..58eed206b0 100644 --- a/app/src/ui/diff/text-diff.tsx +++ b/app/src/ui/diff/text-diff.tsx @@ -40,7 +40,7 @@ import { structuralEquals } from '../../lib/equality' import { assertNever } from '../../lib/fatal-error' import { clamp } from '../../lib/clamp' import { uuid } from '../../lib/uuid' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' import { IMenuItem } from '../../lib/menu-item' import { canSelect, diff --git a/app/src/ui/history/commit-list-item.tsx b/app/src/ui/history/commit-list-item.tsx index 81786ca3c8..c93a14af26 100644 --- a/app/src/ui/history/commit-list-item.tsx +++ b/app/src/ui/history/commit-list-item.tsx @@ -6,7 +6,7 @@ import { RichText } from '../lib/rich-text' import { RelativeTime } from '../relative-time' import { getDotComAPIEndpoint } from '../../lib/api' import { clipboard } from 'electron' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' import { CommitAttribution } from '../lib/commit-attribution' import { AvatarStack } from '../lib/avatar-stack' import { IMenuItem } from '../../lib/menu-item' diff --git a/app/src/ui/history/selected-commit.tsx b/app/src/ui/history/selected-commit.tsx index 576e535ee5..e7177a3d6a 100644 --- a/app/src/ui/history/selected-commit.tsx +++ b/app/src/ui/history/selected-commit.tsx @@ -23,7 +23,7 @@ import { ThrottledScheduler } from '../lib/throttled-scheduler' import { Dispatcher } from '../dispatcher' import { Resizable } from '../resizable' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' import { CommitSummary } from './commit-summary' import { FileList } from './file-list' diff --git a/app/src/ui/lib/author-input.tsx b/app/src/ui/lib/author-input.tsx index 171531c396..91ca1f68ba 100644 --- a/app/src/ui/lib/author-input.tsx +++ b/app/src/ui/lib/author-input.tsx @@ -13,7 +13,7 @@ import { arrayEquals } from '../../lib/equality' import { syncClockwise } from '../octicons' import * as OcticonSymbol from '../octicons/octicons.generated' import { IAuthor } from '../../models/author' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' import { IMenuItem } from '../../lib/menu-item' import { getLegacyStealthEmailForUser } from '../../lib/email' diff --git a/app/src/ui/lib/conflicts/unmerged-file.tsx b/app/src/ui/lib/conflicts/unmerged-file.tsx index 560041add4..49c4878011 100644 --- a/app/src/ui/lib/conflicts/unmerged-file.tsx +++ b/app/src/ui/lib/conflicts/unmerged-file.tsx @@ -10,7 +10,7 @@ import { import { join } from 'path' import { Repository } from '../../../models/repository' import { Dispatcher } from '../../dispatcher' -import { showContextualMenu } from '../../main-process-proxy' +import { showContextualMenu } from '../../../lib/menu-item' import { Octicon } from '../../octicons' import * as OcticonSymbol from '../../octicons/octicons.generated' import { PathText } from '../path-text' diff --git a/app/src/ui/lib/text-area.tsx b/app/src/ui/lib/text-area.tsx index 021298575a..1eef80e323 100644 --- a/app/src/ui/lib/text-area.tsx +++ b/app/src/ui/lib/text-area.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import classNames from 'classnames' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' interface ITextAreaProps { /** The label for the textarea field. */ diff --git a/app/src/ui/lib/text-box.tsx b/app/src/ui/lib/text-box.tsx index 8d63996225..df4f5a1280 100644 --- a/app/src/ui/lib/text-box.tsx +++ b/app/src/ui/lib/text-box.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import classNames from 'classnames' import { createUniqueId, releaseUniqueId } from './id-pool' import { LinkButton } from './link-button' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' export interface ITextBoxProps { /** The label for the input field. */ diff --git a/app/src/ui/main-process-proxy.ts b/app/src/ui/main-process-proxy.ts index 27c8d63739..042d35444c 100644 --- a/app/src/ui/main-process-proxy.ts +++ b/app/src/ui/main-process-proxy.ts @@ -1,5 +1,4 @@ import { ExecutableMenuItem } from '../models/app-menu' -import { IMenuItem, ISerializableMenuItem } from '../lib/menu-item' import { RequestResponseChannels, RequestChannels } from '../lib/ipc-shared' import * as ipcRenderer from '../lib/ipc-renderer' @@ -205,60 +204,7 @@ export const moveToApplicationsFolder = sendProxy( */ export const getAppMenu = sendProxy('get-app-menu', 0) -function findSubmenuItem( - currentContextualMenuItems: ReadonlyArray, - indices: ReadonlyArray -): IMenuItem | undefined { - let foundMenuItem: IMenuItem | undefined = { - submenu: currentContextualMenuItems, - } - - // Traverse the submenus of the context menu until we find the appropriate index. - for (const index of indices) { - if (foundMenuItem === undefined || foundMenuItem.submenu === undefined) { - return undefined - } - - foundMenuItem = foundMenuItem.submenu[index] - } - - return foundMenuItem -} - -const _showContextualMenu = invokeProxy('show-contextual-menu', 2) - -/** Show the given menu items in a contextual menu. */ -export async function showContextualMenu( - items: ReadonlyArray, - addSpellCheckMenu = false -) { - const indices = await _showContextualMenu( - serializeMenuItems(items), - addSpellCheckMenu - ) - - if (indices !== null) { - const menuItem = findSubmenuItem(items, indices) - - if (menuItem !== undefined && menuItem.action !== undefined) { - menuItem.action() - } - } -} - -/** - * Remove the menu items properties that can't be serializable in - * order to pass them via IPC. - */ -function serializeMenuItems( - items: ReadonlyArray -): ReadonlyArray { - return items.map(item => ({ - ...item, - action: undefined, - submenu: item.submenu ? serializeMenuItems(item.submenu) : undefined, - })) -} +export const invokeContextualMenu = invokeProxy('show-contextual-menu', 2) /** Update the menu item labels with the user's preferred apps. */ export const updatePreferredAppMenuItemLabels = sendProxy( diff --git a/app/src/ui/repositories-list/repositories-list.tsx b/app/src/ui/repositories-list/repositories-list.tsx index 24876775f6..21327a0b75 100644 --- a/app/src/ui/repositories-list/repositories-list.tsx +++ b/app/src/ui/repositories-list/repositories-list.tsx @@ -16,7 +16,7 @@ import { Dispatcher } from '../dispatcher' import { Button } from '../lib/button' import { Octicon } from '../octicons' import * as OcticonSymbol from '../octicons/octicons.generated' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' import { IMenuItem } from '../../lib/menu-item' import { PopupType } from '../../models/popup' import { encodePathAsUrl } from '../../lib/path' diff --git a/app/src/ui/repositories-list/repository-list-item.tsx b/app/src/ui/repositories-list/repository-list-item.tsx index f660a56d31..34742ed8c7 100644 --- a/app/src/ui/repositories-list/repository-list-item.tsx +++ b/app/src/ui/repositories-list/repository-list-item.tsx @@ -4,7 +4,7 @@ import { clipboard } from 'electron' import { Repository } from '../../models/repository' import { Octicon, iconForRepository } from '../octicons' import * as OcticonSymbol from '../octicons/octicons.generated' -import { showContextualMenu } from '../main-process-proxy' +import { showContextualMenu } from '../../lib/menu-item' import { Repositoryish } from './group-repositories' import { IMenuItem } from '../../lib/menu-item' import { HighlightText } from '../lib/highlight-text' From 9b368f6dceeff1278640737dce5962dfe182de9a Mon Sep 17 00:00:00 2001 From: Becca Date: Mon, 31 Jan 2022 11:40:30 -0500 Subject: [PATCH 04/18] Release 2.9.7-beta1 --- app/package.json | 2 +- app/src/lib/feature-flag.ts | 2 +- changelog.json | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index d1f81c4c3b..a96faafc20 100644 --- a/app/package.json +++ b/app/package.json @@ -3,7 +3,7 @@ "productName": "GitHub Desktop", "bundleID": "com.github.GitHubClient", "companyName": "GitHub, Inc.", - "version": "2.9.6", + "version": "2.9.7-beta1", "main": "./main.js", "repository": { "type": "git", diff --git a/app/src/lib/feature-flag.ts b/app/src/lib/feature-flag.ts index 48c45a096b..e82d8d722f 100644 --- a/app/src/lib/feature-flag.ts +++ b/app/src/lib/feature-flag.ts @@ -165,5 +165,5 @@ export function enablePullRequestQuickView(): boolean { /** Should we enable high-signal notifications? */ export function enableHighSignalNotifications(): boolean { - return enableDevelopmentFeatures() + return __DARWIN__ ? enableBetaFeatures() : enableDevelopmentFeatures() } diff --git a/changelog.json b/changelog.json index 368ed70126..b853a563fe 100644 --- a/changelog.json +++ b/changelog.json @@ -1,5 +1,20 @@ { "releases": { + "2.9.7-beta1": [ + "[Added] Initial support for high-signal notifications in macOS - #13655", + "[Added] Support pushing workflow files for GitHub Actions to GitHub Enterprise Server - #13640", + "[Added] Support CLion as an external editor - #13739. Thanks @Pinzauti!", + "[Fixed] Fix close button in full screen mode on macOS - #12838", + "[Fixed] Commit message dialog background styles match dialog - #13606", + "[Fixed] Job steps on pull-request check run list are no longer intermittently missing - #13531", + "[Fixed] Take alias into account when sorting repositories - #13429", + "[Improved] Support avatars on GitHub Enterprise Server - #13719", + "[Improved] Fetch before trying to follow a URL link to a specific branch - #13641. Thanks @Bestra!", + "[Improved] Add \"View on GitHub\" context menu option - #13227. Thanks @lhvy!", + "[Improved] Signal when a commit summary is getting long - #2055. Thanks @Twixes!", + "[Improved] Check run group headers and checks stay in view while scrolling the sub checks or job steps. - #13532", + "[Improved] Removed unnecessary punctuation in appearance settings- #13715. Thanks @Pinzauti!" + ], "2.9.6": [ "[Added] View and re-run the check runs for the checked out pull request.", "[Fixed] Tooltip improvements and polish - #13452 #13449", From 9624c70c94c503ff8ea91996558364e66be94da0 Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Mon, 31 Jan 2022 17:47:32 +0100 Subject: [PATCH 05/18] Fix Windows notifications with desktop-notifications --- app/package.json | 1 + app/src/lib/find-toast-activator-clsid.ts | 55 +++++++++++++++++++ .../lib/stores/helpers/show-notification.ts | 37 +++++++++++++ app/yarn.lock | 14 +++++ 4 files changed, 107 insertions(+) create mode 100644 app/src/lib/find-toast-activator-clsid.ts diff --git a/app/package.json b/app/package.json index d1f81c4c3b..f51a71e29b 100644 --- a/app/package.json +++ b/app/package.json @@ -26,6 +26,7 @@ "codemirror-mode-elixir": "^1.1.2", "compare-versions": "^3.6.0", "deep-equal": "^1.0.1", + "desktop-notifications": "^0.1.2", "desktop-trampoline": "desktop/desktop-trampoline#v0.9.8", "detect-arm64-translation": "https://github.com/desktop/node-detect-arm64-translation#v1.0.4", "dexie": "^2.0.0", diff --git a/app/src/lib/find-toast-activator-clsid.ts b/app/src/lib/find-toast-activator-clsid.ts new file mode 100644 index 0000000000..774b9269dd --- /dev/null +++ b/app/src/lib/find-toast-activator-clsid.ts @@ -0,0 +1,55 @@ +import * as path from 'path' +import * as os from 'os' +import { shell } from 'electron' + +/** + * Checks all Windows shortcuts created by Squirrel looking for the toast + * activator CLSID needed to handle Windows notifications from the Action Center. + */ +export function findToastActivatorClsid() { + const shortcutPaths = [ + path.join( + os.homedir(), + 'AppData', + 'Roaming', + 'Microsoft', + 'Windows', + 'Start Menu', + 'Programs', + 'GitHub, Inc', + 'GitHub Desktop.lnk' + ), + path.join(os.homedir(), 'Desktop', 'GitHub Desktop.lnk'), + ] + + for (const shortcutPath of shortcutPaths) { + const toastActivatorClsid = findToastActivatorClsidInShorcut(shortcutPath) + + if (toastActivatorClsid !== undefined) { + return toastActivatorClsid + } + } + + return undefined +} + +function findToastActivatorClsidInShorcut(shortcutPath: string) { + try { + const shortcutDetails = shell.readShortcutLink(shortcutPath) + + if ( + shortcutDetails.toastActivatorClsid === undefined || + shortcutDetails.toastActivatorClsid === '' + ) { + return undefined + } + + return shortcutDetails.toastActivatorClsid + } catch (error) { + console.error( + `Error looking for toast activator CLSID in shortcut ${shortcutPath}`, + error + ) + return undefined + } +} diff --git a/app/src/lib/stores/helpers/show-notification.ts b/app/src/lib/stores/helpers/show-notification.ts index 414c58aca9..ee3976d42f 100644 --- a/app/src/lib/stores/helpers/show-notification.ts +++ b/app/src/lib/stores/helpers/show-notification.ts @@ -1,4 +1,29 @@ import { focusWindow } from '../../../ui/main-process-proxy' +import { + DesktopNotification, + initializeNotifications, +} from 'desktop-notifications' +import { findToastActivatorClsid } from '../../find-toast-activator-clsid' + +let windowsToastActivatorClsid: string | undefined = undefined + +function initializeWindowsNotifications() { + if (windowsToastActivatorClsid !== undefined) { + return + } + + windowsToastActivatorClsid = findToastActivatorClsid() + + if (windowsToastActivatorClsid === undefined) { + console.error( + 'Toast activator CLSID not found in any of the shortucts. Notifications will not work.' + ) + return + } + + console.log(`Found toast activator CLSID ${windowsToastActivatorClsid}`) + initializeNotifications(windowsToastActivatorClsid) +} /** * Shows a notification with a title, a body, and a function to handle when the @@ -9,6 +34,18 @@ export function showNotification( body: string, onClick: () => void ) { + if (__WIN32__) { + initializeWindowsNotifications() + + const notification = new DesktopNotification(title, body) + notification.onclick = () => { + focusWindow() + onClick() + } + notification.show() + return + } + const notification = new Notification(title, { body, }) diff --git a/app/yarn.lock b/app/yarn.lock index 443ef56316..edfd374015 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -326,6 +326,15 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= +desktop-notifications@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/desktop-notifications/-/desktop-notifications-0.1.2.tgz#c76750f4f102824e2ee3bbdadb509d36d01b7a85" + integrity sha512-JQMn/HilzRnmzigcnAmUcp4Z5ihTC/XK2lDd/ib8AST7QC5N9V8ENWAdMBgKCRQQRBUJkOXYpN7rLwjDEvNxMA== + dependencies: + node-addon-api "^3.1.0" + prebuild-install "^5.3.5" + uuid "^8.3.2" + desktop-trampoline@desktop/desktop-trampoline#v0.9.8: version "0.9.8" resolved "https://codeload.github.com/desktop/desktop-trampoline/tar.gz/cbd3dbb31d0d3ea9f325067f48bfbf60b6663a57" @@ -1719,6 +1728,11 @@ uuid@^3.0.1: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" integrity sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g== +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + warning@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c" From 1d5a53ae7f78e83d613f4f66b5be2bcafc5cba7f Mon Sep 17 00:00:00 2001 From: Becca Date: Mon, 31 Jan 2022 11:48:51 -0500 Subject: [PATCH 06/18] Electron upgrade release note.. --- changelog.json | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.json b/changelog.json index b853a563fe..b2523d8e85 100644 --- a/changelog.json +++ b/changelog.json @@ -8,6 +8,7 @@ "[Fixed] Commit message dialog background styles match dialog - #13606", "[Fixed] Job steps on pull-request check run list are no longer intermittently missing - #13531", "[Fixed] Take alias into account when sorting repositories - #13429", + "[Improved] Upgrade to Electron v14.2.3 - #13689", "[Improved] Support avatars on GitHub Enterprise Server - #13719", "[Improved] Fetch before trying to follow a URL link to a specific branch - #13641. Thanks @Bestra!", "[Improved] Add \"View on GitHub\" context menu option - #13227. Thanks @lhvy!", From d927121406b061e851b31fc1313de7e3a3fd4034 Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Mon, 31 Jan 2022 11:51:03 -0500 Subject: [PATCH 07/18] Notifications are new! Co-authored-by: Billy Griffin <5091167+billygriffin@users.noreply.github.com> --- changelog.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.json b/changelog.json index b2523d8e85..32c6474ae4 100644 --- a/changelog.json +++ b/changelog.json @@ -1,7 +1,7 @@ { "releases": { "2.9.7-beta1": [ - "[Added] Initial support for high-signal notifications in macOS - #13655", + "[New] Initial support for high-signal notifications in macOS - #13655", "[Added] Support pushing workflow files for GitHub Actions to GitHub Enterprise Server - #13640", "[Added] Support CLion as an external editor - #13739. Thanks @Pinzauti!", "[Fixed] Fix close button in full screen mode on macOS - #12838", From cc50b45da558fa93dfd70a69ea4e44eacd83640f Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Mon, 31 Jan 2022 11:51:22 -0500 Subject: [PATCH 08/18] Update changelog.json Co-authored-by: Billy Griffin <5091167+billygriffin@users.noreply.github.com> --- changelog.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.json b/changelog.json index 32c6474ae4..91e334c402 100644 --- a/changelog.json +++ b/changelog.json @@ -6,7 +6,7 @@ "[Added] Support CLion as an external editor - #13739. Thanks @Pinzauti!", "[Fixed] Fix close button in full screen mode on macOS - #12838", "[Fixed] Commit message dialog background styles match dialog - #13606", - "[Fixed] Job steps on pull-request check run list are no longer intermittently missing - #13531", + "[Fixed] Ensure job steps on pull request check run list are always present - #13531", "[Fixed] Take alias into account when sorting repositories - #13429", "[Improved] Upgrade to Electron v14.2.3 - #13689", "[Improved] Support avatars on GitHub Enterprise Server - #13719", From 4902a7a347857ed8e16897e0b15b18cc14ae6667 Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Mon, 31 Jan 2022 11:51:35 -0500 Subject: [PATCH 09/18] Update changelog.json Co-authored-by: Billy Griffin <5091167+billygriffin@users.noreply.github.com> --- changelog.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.json b/changelog.json index 91e334c402..0147a417e7 100644 --- a/changelog.json +++ b/changelog.json @@ -7,7 +7,7 @@ "[Fixed] Fix close button in full screen mode on macOS - #12838", "[Fixed] Commit message dialog background styles match dialog - #13606", "[Fixed] Ensure job steps on pull request check run list are always present - #13531", - "[Fixed] Take alias into account when sorting repositories - #13429", + "[Improved] Take alias into account when sorting repositories - #13429", "[Improved] Upgrade to Electron v14.2.3 - #13689", "[Improved] Support avatars on GitHub Enterprise Server - #13719", "[Improved] Fetch before trying to follow a URL link to a specific branch - #13641. Thanks @Bestra!", From 140e40ad4a382740f8a84a30602003f9ed2338ad Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Mon, 31 Jan 2022 11:51:43 -0500 Subject: [PATCH 10/18] Update changelog.json Co-authored-by: Billy Griffin <5091167+billygriffin@users.noreply.github.com> --- changelog.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.json b/changelog.json index 0147a417e7..7c8da97351 100644 --- a/changelog.json +++ b/changelog.json @@ -14,7 +14,7 @@ "[Improved] Add \"View on GitHub\" context menu option - #13227. Thanks @lhvy!", "[Improved] Signal when a commit summary is getting long - #2055. Thanks @Twixes!", "[Improved] Check run group headers and checks stay in view while scrolling the sub checks or job steps. - #13532", - "[Improved] Removed unnecessary punctuation in appearance settings- #13715. Thanks @Pinzauti!" + "[Improved] Remove unnecessary punctuation in appearance settings- #13715. Thanks @Pinzauti!" ], "2.9.6": [ "[Added] View and re-run the check runs for the checked out pull request.", From d4bf2c441795cab36e63e1fe428954ae1164a6ef Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Mon, 31 Jan 2022 11:55:39 -0500 Subject: [PATCH 11/18] Update changelog.json Co-authored-by: Billy Griffin <5091167+billygriffin@users.noreply.github.com> --- changelog.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.json b/changelog.json index 7c8da97351..d7917807fc 100644 --- a/changelog.json +++ b/changelog.json @@ -1,7 +1,7 @@ { "releases": { "2.9.7-beta1": [ - "[New] Initial support for high-signal notifications in macOS - #13655", + "[New] Initial support for system notifications when checks fail in macOS - #13655", "[Added] Support pushing workflow files for GitHub Actions to GitHub Enterprise Server - #13640", "[Added] Support CLion as an external editor - #13739. Thanks @Pinzauti!", "[Fixed] Fix close button in full screen mode on macOS - #12838", From f980846d651219735d87f8ed6c8fb6d04bf2fb68 Mon Sep 17 00:00:00 2001 From: tidy-dev <75402236+tidy-dev@users.noreply.github.com> Date: Mon, 31 Jan 2022 14:28:05 -0500 Subject: [PATCH 12/18] Update changelog.json --- changelog.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.json b/changelog.json index d7917807fc..4fd9513ac3 100644 --- a/changelog.json +++ b/changelog.json @@ -11,7 +11,7 @@ "[Improved] Upgrade to Electron v14.2.3 - #13689", "[Improved] Support avatars on GitHub Enterprise Server - #13719", "[Improved] Fetch before trying to follow a URL link to a specific branch - #13641. Thanks @Bestra!", - "[Improved] Add \"View on GitHub\" context menu option - #13227. Thanks @lhvy!", + "[Improved] Add \"View on GitHub\" context menu option to repository list items - #13227. Thanks @lhvy!", "[Improved] Signal when a commit summary is getting long - #2055. Thanks @Twixes!", "[Improved] Check run group headers and checks stay in view while scrolling the sub checks or job steps. - #13532", "[Improved] Remove unnecessary punctuation in appearance settings- #13715. Thanks @Pinzauti!" From 5c0501d399ee92af55dbae1fb771acf06cb58d55 Mon Sep 17 00:00:00 2001 From: Markus Olsson Date: Tue, 1 Feb 2022 13:36:21 +0100 Subject: [PATCH 13/18] Bump to Node 14.17.0 --- .github/workflows/ci.yml | 2 +- .node-version | 2 +- .nvmrc | 2 +- .tool-versions | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de990c5660..4d8ed2a2b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - node: [14.15.4] + node: [14.17.0] os: [macos-10.15, windows-2019] arch: [x64, arm64] include: diff --git a/.node-version b/.node-version index 2f5ee741e0..62df50f1ee 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -14.15.1 +14.17.0 diff --git a/.nvmrc b/.nvmrc index 9a0c3d3f45..cab13a7963 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v14.15.4 +v14.17.0 diff --git a/.tool-versions b/.tool-versions index ccf03d190b..843f740e8b 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ python 3.9.5 -nodejs 14.15.1 +nodejs 14.17.0 From 68285a98483abbbd1b9c1b5a9bfceb8f95b83e70 Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Tue, 1 Feb 2022 18:45:28 +0100 Subject: [PATCH 14/18] Fall back to known CLSID for notifications --- app/src/lib/stores/helpers/show-notification.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/lib/stores/helpers/show-notification.ts b/app/src/lib/stores/helpers/show-notification.ts index ee3976d42f..4a084fee24 100644 --- a/app/src/lib/stores/helpers/show-notification.ts +++ b/app/src/lib/stores/helpers/show-notification.ts @@ -16,12 +16,15 @@ function initializeWindowsNotifications() { if (windowsToastActivatorClsid === undefined) { console.error( - 'Toast activator CLSID not found in any of the shortucts. Notifications will not work.' + 'Toast activator CLSID not found in any of the shortucts. Falling back to known CLSIDs.' ) - return + + // This is generated by Squirrel.Windows here: + // https://github.com/Squirrel/Squirrel.Windows/blob/7396fa50ccebf97e28c79ef519c07cb9eee121be/src/Squirrel/UpdateManager.ApplyReleases.cs#L258 + windowsToastActivatorClsid = '{27D44D0C-A542-5B90-BCDB-AC3126048BA2}' } - console.log(`Found toast activator CLSID ${windowsToastActivatorClsid}`) + console.log(`Using toast activator CLSID ${windowsToastActivatorClsid}`) initializeNotifications(windowsToastActivatorClsid) } From 5fa9c2bf1913c0a775099e57d7268df6f839cc76 Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Tue, 1 Feb 2022 18:47:30 +0100 Subject: [PATCH 15/18] Bump desktop-notifications to 0.1.4 --- app/package.json | 2 +- app/yarn.lock | 88 ++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 83 insertions(+), 7 deletions(-) diff --git a/app/package.json b/app/package.json index f51a71e29b..80779cee80 100644 --- a/app/package.json +++ b/app/package.json @@ -26,7 +26,7 @@ "codemirror-mode-elixir": "^1.1.2", "compare-versions": "^3.6.0", "deep-equal": "^1.0.1", - "desktop-notifications": "^0.1.2", + "desktop-notifications": "^0.1.4", "desktop-trampoline": "desktop/desktop-trampoline#v0.9.8", "detect-arm64-translation": "https://github.com/desktop/node-detect-arm64-translation#v1.0.4", "dexie": "^2.0.0", diff --git a/app/yarn.lock b/app/yarn.lock index edfd374015..dff1fcc555 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -306,6 +306,13 @@ decompress-response@^4.2.0: dependencies: mimic-response "^2.0.0" +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + deep-equal@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -326,13 +333,13 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= -desktop-notifications@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/desktop-notifications/-/desktop-notifications-0.1.2.tgz#c76750f4f102824e2ee3bbdadb509d36d01b7a85" - integrity sha512-JQMn/HilzRnmzigcnAmUcp4Z5ihTC/XK2lDd/ib8AST7QC5N9V8ENWAdMBgKCRQQRBUJkOXYpN7rLwjDEvNxMA== +desktop-notifications@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/desktop-notifications/-/desktop-notifications-0.1.4.tgz#698c5822fb88d7a2289f36b4f64eaac8b5bdefed" + integrity sha512-3ADhNvqL9ISbN17x/hWcYUcGHvWJxPnoxxsQbmrU26wpk2eakvDplCm0fvNIpHx/Ar5O7n1VmMOVmLr8W6B8sQ== dependencies: - node-addon-api "^3.1.0" - prebuild-install "^5.3.5" + node-addon-api "^4.3.0" + prebuild-install "^7.0.1" uuid "^8.3.2" desktop-trampoline@desktop/desktop-trampoline#v0.9.8: @@ -354,6 +361,11 @@ detect-libc@^1.0.3: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= +detect-libc@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.0.tgz#c528bc09bc6d1aa30149228240917c225448f204" + integrity sha512-S55LzUl8HUav8l9E2PBTlC5PAJrHK7tkM+XXFGD+fbsbkTzhCpG6K05LxJcUOEWzMa4v6ptcMZ9s3fOdJDu0Zw== + devtron@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/devtron/-/devtron-1.4.0.tgz#b5e748bd6e95bbe70bfcc68aae6fe696119441e1" @@ -897,6 +909,13 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + map-age-cleaner@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" @@ -943,6 +962,11 @@ mimic-response@^2.0.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.0.0.tgz#996a51c60adf12cb8a87d7fb8ef24c2f3d5ebb46" integrity sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ== +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -1036,6 +1060,13 @@ node-abi@^2.7.0: dependencies: semver "^5.4.1" +node-abi@^3.3.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.7.0.tgz#ed980f6dbb6db9ff3b31aeb27d43cd9b096f6e9e" + integrity sha512-3J+U4CvxVNEk9+lGdJkmYbN8cIN0HMTDT9R0ezX7pmp7aD6BaKsfAHwVn3IvVg6pYIRUuQ+gHW1eawrvywnSQQ== + dependencies: + semver "^7.3.5" + node-addon-api@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.0.2.tgz#04bc7b83fd845ba785bb6eae25bc857e1ef75681" @@ -1046,6 +1077,11 @@ node-addon-api@^3.1.0: resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.1.0.tgz#98b21931557466c6729e51cb77cd39c965f42239" integrity sha512-flmrDNB06LIl5lywUz7YlNGZH/5p0M7W28k8hzd9Lshtdh1wshD2Y+U4h9LD6KObOy1f+fEVdgprPrEymjM5uw== +node-addon-api@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" + integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== + node-fetch@^1.0.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" @@ -1208,6 +1244,25 @@ prebuild-install@^6.0.0: tunnel-agent "^0.6.0" which-pm-runs "^1.0.0" +prebuild-install@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.0.1.tgz#c10075727c318efe72412f333e0ef625beaf3870" + integrity sha512-QBSab31WqkyxpnMWQxubYAHR5S9B2+r81ucocew34Fkl98FhvKIF50jIJnNOBmAZfyNV7vE5T6gd3hTVWgY6tg== + dependencies: + detect-libc "^2.0.0" + expand-template "^2.0.3" + github-from-package "0.0.0" + minimist "^1.2.3" + mkdirp-classic "^0.5.3" + napi-build-utils "^1.0.1" + node-abi "^3.3.0" + npmlog "^4.0.1" + pump "^3.0.0" + rc "^1.2.7" + simple-get "^4.0.0" + tar-fs "^2.0.0" + tunnel-agent "^0.6.0" + prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" @@ -1475,6 +1530,13 @@ semver@^7.2.1: resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== +semver@^7.3.5: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -1521,6 +1583,15 @@ simple-get@^3.0.3: once "^1.3.1" simple-concat "^1.0.0" +simple-get@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" + integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== + dependencies: + decompress-response "^6.0.0" + once "^1.3.1" + simple-concat "^1.0.0" + source-map-support@^0.4.15: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" @@ -1830,3 +1901,8 @@ yallist@^3.0.0, yallist@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== From deb8f784770aef124ca401f3f7f5089c9eb7ac80 Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Wed, 2 Feb 2022 11:26:08 +0100 Subject: [PATCH 16/18] Bump keytar to v7.8.0 --- app/package.json | 2 +- app/yarn.lock | 91 ++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 82 insertions(+), 11 deletions(-) diff --git a/app/package.json b/app/package.json index a96faafc20..288a6fbe56 100644 --- a/app/package.json +++ b/app/package.json @@ -41,7 +41,7 @@ "fs-admin": "^0.19.0", "fs-extra": "^9.0.1", "fuzzaldrin-plus": "^0.6.0", - "keytar": "^7.7.0", + "keytar": "^7.8.0", "marked": "^4.0.10", "mem": "^4.3.0", "memoize-one": "^4.0.3", diff --git a/app/yarn.lock b/app/yarn.lock index 443ef56316..8525ea822f 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -306,6 +306,13 @@ decompress-response@^4.2.0: dependencies: mimic-response "^2.0.0" +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + deep-equal@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -345,6 +352,11 @@ detect-libc@^1.0.3: resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= +detect-libc@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.0.tgz#c528bc09bc6d1aa30149228240917c225448f204" + integrity sha512-S55LzUl8HUav8l9E2PBTlC5PAJrHK7tkM+XXFGD+fbsbkTzhCpG6K05LxJcUOEWzMa4v6ptcMZ9s3fOdJDu0Zw== + devtron@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/devtron/-/devtron-1.4.0.tgz#b5e748bd6e95bbe70bfcc68aae6fe696119441e1" @@ -832,13 +844,13 @@ keyboardevents-areequal@^0.2.1: resolved "https://registry.yarnpkg.com/keyboardevents-areequal/-/keyboardevents-areequal-0.2.2.tgz#88191ec738ce9f7591c25e9056de928b40277194" integrity sha512-Nv+Kr33T0mEjxR500q+I6IWisOQ0lK1GGOncV0kWE6n4KFmpcu7RUX5/2B0EUtX51Cb0HjZ9VJsSY3u4cBa0kw== -keytar@^7.7.0: - version "7.7.0" - resolved "https://registry.yarnpkg.com/keytar/-/keytar-7.7.0.tgz#3002b106c01631aa79b1aa9ee0493b94179bbbd2" - integrity sha512-YEY9HWqThQc5q5xbXbRwsZTh2PJ36OSYRjSv3NN2xf5s5dpLTjEZnC2YikR29OaVybf9nQ0dJ/80i40RS97t/A== +keytar@^7.8.0: + version "7.8.0" + resolved "https://registry.yarnpkg.com/keytar/-/keytar-7.8.0.tgz#28cf5ceeb1275350888870022869b8b4fe6a87f9" + integrity sha512-mR+BqtAOIW8j+T5FtLVyckCbvROWQD+4FzPeFMuk5njEZkXLpVPCGF26Y3mTyxMAAL1XCfswR7S6kIf+THSRFA== dependencies: - node-addon-api "^3.0.0" - prebuild-install "^6.0.0" + node-addon-api "^4.3.0" + prebuild-install "^7.0.1" keyv@^3.0.0: version "3.1.0" @@ -888,6 +900,13 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + map-age-cleaner@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" @@ -934,6 +953,11 @@ mimic-response@^2.0.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.0.0.tgz#996a51c60adf12cb8a87d7fb8ef24c2f3d5ebb46" integrity sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ== +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -1027,16 +1051,23 @@ node-abi@^2.7.0: dependencies: semver "^5.4.1" -node-addon-api@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.0.2.tgz#04bc7b83fd845ba785bb6eae25bc857e1ef75681" - integrity sha512-+D4s2HCnxPd5PjjI0STKwncjXTUKKqm74MDMz9OPXavjsGmjkvwgLtA5yoxJUdmpj52+2u+RrXgPipahKczMKg== +node-abi@^3.3.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.7.0.tgz#ed980f6dbb6db9ff3b31aeb27d43cd9b096f6e9e" + integrity sha512-3J+U4CvxVNEk9+lGdJkmYbN8cIN0HMTDT9R0ezX7pmp7aD6BaKsfAHwVn3IvVg6pYIRUuQ+gHW1eawrvywnSQQ== + dependencies: + semver "^7.3.5" node-addon-api@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.1.0.tgz#98b21931557466c6729e51cb77cd39c965f42239" integrity sha512-flmrDNB06LIl5lywUz7YlNGZH/5p0M7W28k8hzd9Lshtdh1wshD2Y+U4h9LD6KObOy1f+fEVdgprPrEymjM5uw== +node-addon-api@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" + integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== + node-fetch@^1.0.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" @@ -1199,6 +1230,25 @@ prebuild-install@^6.0.0: tunnel-agent "^0.6.0" which-pm-runs "^1.0.0" +prebuild-install@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.0.1.tgz#c10075727c318efe72412f333e0ef625beaf3870" + integrity sha512-QBSab31WqkyxpnMWQxubYAHR5S9B2+r81ucocew34Fkl98FhvKIF50jIJnNOBmAZfyNV7vE5T6gd3hTVWgY6tg== + dependencies: + detect-libc "^2.0.0" + expand-template "^2.0.3" + github-from-package "0.0.0" + minimist "^1.2.3" + mkdirp-classic "^0.5.3" + napi-build-utils "^1.0.1" + node-abi "^3.3.0" + npmlog "^4.0.1" + pump "^3.0.0" + rc "^1.2.7" + simple-get "^4.0.0" + tar-fs "^2.0.0" + tunnel-agent "^0.6.0" + prepend-http@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" @@ -1466,6 +1516,13 @@ semver@^7.2.1: resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== +semver@^7.3.5: + version "7.3.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -1512,6 +1569,15 @@ simple-get@^3.0.3: once "^1.3.1" simple-concat "^1.0.0" +simple-get@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" + integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== + dependencies: + decompress-response "^6.0.0" + once "^1.3.1" + simple-concat "^1.0.0" + source-map-support@^0.4.15: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" @@ -1816,3 +1882,8 @@ yallist@^3.0.0, yallist@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== From 0062f3e63e9092841b70e25e79499a5eb13aa5a0 Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Wed, 2 Feb 2022 12:31:22 +0100 Subject: [PATCH 17/18] Use our logger instead of console :facepalm: --- app/src/lib/find-toast-activator-clsid.ts | 2 +- app/src/lib/stores/helpers/show-notification.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/lib/find-toast-activator-clsid.ts b/app/src/lib/find-toast-activator-clsid.ts index 774b9269dd..1369321d75 100644 --- a/app/src/lib/find-toast-activator-clsid.ts +++ b/app/src/lib/find-toast-activator-clsid.ts @@ -46,7 +46,7 @@ function findToastActivatorClsidInShorcut(shortcutPath: string) { return shortcutDetails.toastActivatorClsid } catch (error) { - console.error( + log.error( `Error looking for toast activator CLSID in shortcut ${shortcutPath}`, error ) diff --git a/app/src/lib/stores/helpers/show-notification.ts b/app/src/lib/stores/helpers/show-notification.ts index 4a084fee24..38a9406206 100644 --- a/app/src/lib/stores/helpers/show-notification.ts +++ b/app/src/lib/stores/helpers/show-notification.ts @@ -15,7 +15,7 @@ function initializeWindowsNotifications() { windowsToastActivatorClsid = findToastActivatorClsid() if (windowsToastActivatorClsid === undefined) { - console.error( + log.error( 'Toast activator CLSID not found in any of the shortucts. Falling back to known CLSIDs.' ) @@ -24,7 +24,7 @@ function initializeWindowsNotifications() { windowsToastActivatorClsid = '{27D44D0C-A542-5B90-BCDB-AC3126048BA2}' } - console.log(`Using toast activator CLSID ${windowsToastActivatorClsid}`) + log.info(`Using toast activator CLSID ${windowsToastActivatorClsid}`) initializeNotifications(windowsToastActivatorClsid) } From 434ce73c25b947ed4f6ad2668043d7adc94e432b Mon Sep 17 00:00:00 2001 From: Becca Date: Wed, 2 Feb 2022 08:29:41 -0500 Subject: [PATCH 18/18] Remove note from old logic Co-Authored-By: Sergio Padrino <1083228+sergiou87@users.noreply.github.com> --- app/src/main-process/menu/build-spell-check-menu.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main-process/menu/build-spell-check-menu.ts b/app/src/main-process/menu/build-spell-check-menu.ts index fc6d6d225a..2e39aa1df6 100644 --- a/app/src/main-process/menu/build-spell-check-menu.ts +++ b/app/src/main-process/menu/build-spell-check-menu.ts @@ -4,7 +4,6 @@ export async function buildSpellCheckMenu( window: BrowserWindow | undefined ): Promise | undefined> { if (window === undefined) { - // window.webContents.off('context-menu', mergeDeferredContextMenuItems) return }