mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-11-04 20:38:03 +00:00
Fix tray icon always on (regression from #1235)
This commit is contained in:
parent
a491e34966
commit
d69d4b253a
@ -9,7 +9,7 @@ export function createTrayIcon(
|
||||
): Tray {
|
||||
const options = { ...nativefierOptions };
|
||||
|
||||
if (options.tray) {
|
||||
if (options.tray && options.tray !== 'false') {
|
||||
const iconPath = getAppIcon();
|
||||
const nimage = nativeImage.createFromPath(iconPath);
|
||||
const appIcon = new Tray(nativeImage.createEmpty());
|
||||
|
@ -309,23 +309,22 @@ describe('initArgs + parseArgs', () => {
|
||||
{ arg: 'tray', value: 'false' },
|
||||
{ arg: 'tray', value: 'start-in-tray' },
|
||||
{ arg: 'tray', value: '' },
|
||||
{ arg: 'tray', value: undefined },
|
||||
])('test tray valyue %s', ({ arg, value }) => {
|
||||
if (value !== undefined) {
|
||||
const args = parseArgs(
|
||||
initArgs(['https://google.com', `--${arg}`, `${value}`]),
|
||||
) as Record<string, number>;
|
||||
if (value !== '') {
|
||||
expect(args[arg]).toBe(value);
|
||||
} else {
|
||||
expect(args[arg]).toBe('true');
|
||||
}
|
||||
const args = parseArgs(
|
||||
initArgs(['https://google.com', `--${arg}`, `${value}`]),
|
||||
) as Record<string, number>;
|
||||
if (value !== '') {
|
||||
expect(args[arg]).toBe(value);
|
||||
} else {
|
||||
const args = parseArgs(initArgs(['https://google.com'])) as Record<
|
||||
string,
|
||||
number
|
||||
>;
|
||||
expect(args[arg]).toBe('false');
|
||||
expect(args[arg]).toBe('true');
|
||||
}
|
||||
});
|
||||
|
||||
test('test tray value defaults to false', () => {
|
||||
const args = parseArgs(initArgs(['https://google.com'])) as Record<
|
||||
string,
|
||||
number
|
||||
>;
|
||||
expect(args.tray).toBe('false');
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user