Skip to content

Commit

Permalink
Merge branch 'main' into feature/check-for-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed Jul 23, 2024
2 parents b947781 + ef98f1a commit 58eb1c0
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 77 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"class-variance-authority": "0.7.0",
"clsx": "2.1.1",
"date-fns": "3.6.0",
"electron-log": "^5.1.6",
"electron-log": "5.1.6",
"electron-updater": "6.3.0",
"final-form": "4.20.10",
"menubar": "9.5.0",
Expand All @@ -117,7 +117,7 @@
"react-router-dom": "6.25.1",
"tailwind-merge": "2.4.0",
"ts-loader": "9.5.1",
"typescript": "5.5.3"
"typescript": "5.5.4"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
Expand Down
82 changes: 41 additions & 41 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"config:recommended",
":separateMultipleMajorReleases",
":enableVulnerabilityAlerts",
"schedule:weekly",
"regexManagers:biomeVersions"
],
"labels": ["dependency"],
Expand Down
4 changes: 2 additions & 2 deletions src/electron/first-run.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { app, dialog } = require('electron');

const fs = require('node:fs');
const path = require('node:path');
const log = require('electron-log');

async function onFirstRunMaybe() {
if (isFirstRun()) {
Expand Down Expand Up @@ -49,7 +49,7 @@ function isFirstRun() {

fs.writeFileSync(configPath, '');
} catch (error) {
console.warn('First run: Unable to write firstRun file', error);
log.warn('First run: Unable to write firstRun file', error);
}

return true;
Expand Down
22 changes: 14 additions & 8 deletions src/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { onFirstRunMaybe } = require('./first-run');
const path = require('node:path');
const log = require('electron-log');

log.initialize();
autoUpdater.logger = log;

// TODO: Remove @electron/remote use - see #650
Expand Down Expand Up @@ -60,18 +61,22 @@ const contextMenu = Menu.buildFromTemplate([
},
},
{ type: 'separator' },

{
role: 'reload',
accelerator: 'CommandOrControl+R',
},
{
role: 'toggleDevTools',
accelerator: 'CommandOrControl+I',
label: 'Developer',
submenu: [
{
role: 'reload',
accelerator: 'CommandOrControl+R',
},
{
role: 'toggleDevTools',
accelerator: 'CommandOrControl+I',
},
],
},
{ type: 'separator' },
{
label: 'Quit',
label: 'Quit Gitify',
accelerator: 'CommandOrControl+Q',
click: () => {
app.quit();
Expand All @@ -94,6 +99,7 @@ app.whenReady().then(async () => {
mb.app.setAppUserModelId('com.electron.gitify');

// Tray configuration
mb.tray.setToolTip('Gitify');
mb.tray.setIgnoreDoubleClickEvents(true);
mb.tray.on('right-click', (_event, bounds) => {
mb.tray.popUpContextMenu(contextMenu, { x: bounds.x, y: bounds.y });
Expand Down
5 changes: 3 additions & 2 deletions src/utils/api/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios, { type AxiosPromise, type AxiosResponse } from 'axios';
import log from 'electron-log';
import {
mockGitHubCloudAccount,
mockGitHubEnterpriseServerAccount,
Expand Down Expand Up @@ -278,7 +279,7 @@ describe('utils/api/client.ts', () => {
});

it('should handle error', async () => {
const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation();
const logErrorSpy = jest.spyOn(log, 'error').mockImplementation();

const apiRequestAuthMock = jest.spyOn(apiRequests, 'apiRequestAuth');

Expand All @@ -291,7 +292,7 @@ describe('utils/api/client.ts', () => {
'123' as Token,
);

expect(consoleErrorSpy).toHaveBeenCalledWith('Failed to get html url');
expect(logErrorSpy).toHaveBeenCalledWith('Failed to get html url');
});
});
});
Loading

0 comments on commit 58eb1c0

Please sign in to comment.