Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions electron-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const config = {
mac: {
category: 'public.app-category.developer-tools',
icon: 'assets/images/app-icon.icns',
extendInfo: {
LSUIElement: true,
},
identity: 'Adam Setch (5KD23H9729)',
type: 'distribution',
notarize: false, // Handle notarization in afterSign.js
Expand Down
24 changes: 1 addition & 23 deletions src/main/lifecycle/first-run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ vi.mock('node:fs', () => ({
const moveToApplicationsFolderMock = vi.fn();
const isInApplicationsFolderMock = vi.fn(() => false);
const getPathMock = vi.fn(() => '/User/Data');
const dockHideMock = vi.fn();

const showMessageBoxMock = vi.fn(async () => ({
response: 0,
Expand All @@ -31,15 +30,7 @@ vi.mock('electron', () => ({
getPath: () => getPathMock(),
isInApplicationsFolder: () => isInApplicationsFolderMock(),
moveToApplicationsFolder: () => moveToApplicationsFolderMock(),
dock: {
hide: () => dockHideMock(),
},
} satisfies Pick<
Electron.App,
'getPath' | 'isInApplicationsFolder' | 'moveToApplicationsFolder'
> & {
dock: { hide: () => void };
},
} satisfies Pick<Electron.App, 'getPath' | 'isInApplicationsFolder' | 'moveToApplicationsFolder'>,
dialog: {
showMessageBox: () => showMessageBoxMock(),
} satisfies Pick<Electron.Dialog, 'showMessageBox'>,
Expand Down Expand Up @@ -134,19 +125,6 @@ describe('main/lifecycle/first-run', () => {
expect(moveToApplicationsFolderMock).not.toHaveBeenCalled();
});

it('re-hides the dock icon after the prompt closes (#3069)', async () => {
existsSyncMock.mockReturnValueOnce(false);
existsSyncMock.mockReturnValueOnce(false);
showMessageBoxMock.mockResolvedValueOnce({
response: 1,
checkboxChecked: false,
});

await onFirstRunMaybe();

expect(dockHideMock).toHaveBeenCalled();
});

it('does not prompt on non-macOS', async () => {
mac = false;
existsSyncMock.mockReturnValueOnce(false);
Expand Down
4 changes: 0 additions & 4 deletions src/main/lifecycle/first-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ async function promptMoveToApplicationsFolder() {
message: 'Move to Applications Folder?',
});

// Parentless dialogs pull a dock-hidden (accessory) app into the Dock and
// macOS does not restore the accessory policy on close; re-hide (#3069).
app.dock?.hide();

if (response === 0) {
app.moveToApplicationsFolder();
}
Expand Down
10 changes: 2 additions & 8 deletions src/main/updater.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, dialog } from 'electron';
import { dialog } from 'electron';
import type { Menubar } from 'electron-menubar';

import { APPLICATION } from '../shared/constants';
Expand Down Expand Up @@ -45,11 +45,6 @@ vi.mock('electron', () => {
}
}
return {
app: {
dock: {
hide: vi.fn(),
},
},
dialog: {
showMessageBox: vi.fn(),
} satisfies Pick<Electron.Dialog, 'showMessageBox'>,
Expand Down Expand Up @@ -145,7 +140,7 @@ describe('main/updater.ts', () => {
expect(autoUpdater.quitAndInstall).toHaveBeenCalled();
});

it('re-hides the dock icon when user dismisses the dialog (#3069)', async () => {
it('does not install when user dismisses the dialog', async () => {
vi.mocked(dialog.showMessageBox).mockResolvedValue({
response: 1, // "Later" button index
checkboxChecked: false,
Expand All @@ -159,7 +154,6 @@ describe('main/updater.ts', () => {
await Promise.resolve();

expect(autoUpdater.quitAndInstall).not.toHaveBeenCalled();
expect(app.dock?.hide).toHaveBeenCalled();
});
});

Expand Down
9 changes: 1 addition & 8 deletions src/main/updater.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, dialog, type MessageBoxOptions } from 'electron';
import { dialog, type MessageBoxOptions } from 'electron';
import type { Menubar } from 'electron-menubar';
import { autoUpdater } from 'electron-updater';

Expand Down Expand Up @@ -200,14 +200,7 @@ export default class AppUpdater {
dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) {
autoUpdater.quitAndInstall();
return;
}

// Presenting a parentless dialog forces a dock-hidden (accessory) macOS
// app to activate into the Dock, and the accessory policy is not
// restored when the dialog closes. Re-assert it so the dock icon
// disappears again (#3069).
app.dock?.hide();
});
}
}