Skip to content

Commit

Permalink
SDA-4344 Electron upgrade (#1962)
Browse files Browse the repository at this point in the history
* SDA-4344 Electron upgrade

* Typing update
  • Loading branch information
sbenmoussati committed Sep 28, 2023
1 parent 0996840 commit 45b9141
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
19 changes: 9 additions & 10 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "symphony",
"productName": "Symphony",
"version": "23.9.0",
"version": "23.9.1",
"clientVersion": "2.0.1",
"buildNumber": "0",
"searchAPIVersion": "1.55.3",
Expand Down Expand Up @@ -178,7 +178,7 @@
"builder-util-runtime": "^9.0.3",
"cross-env": "7.0.3",
"del": "3.0.0",
"electron": "25.3.1",
"electron": "25.8.4",
"electron-builder": "^24.2.1",
"electron-icon-maker": "0.0.5",
"electron-osx-sign": "^0.6.0",
Expand Down
6 changes: 3 additions & 3 deletions src/app/activity-detection.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { app, powerMonitor, WebContents } from 'electron';
import Timer = NodeJS.Timer;
import Timeout = NodeJS.Timeout;

import { logger } from '../common/logger';
import { windowHandler } from './window-handler';

class ActivityDetection {
private idleThreshold: number;
private window: WebContents | null;
private timer: Timer | undefined;
private queryInterval: NodeJS.Timer | undefined;
private timer: Timeout | undefined;
private queryInterval: Timeout | undefined;

constructor() {
this.idleThreshold = 60 * 60 * 1000;
Expand Down
9 changes: 6 additions & 3 deletions src/common/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// regex match the semver (semantic version) this checks for the pattern X.Y.Z
// ex-valid v1.2.0, 1.2.0, 2.3.4-r51
const semver = /^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?)?)?$/i;
const semver =
/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?)?)?$/i;
const patch = /-([0-9A-Za-z-.]+)/;

/**
Expand Down Expand Up @@ -205,15 +206,17 @@ export const throttle = (
);
}

let timer: NodeJS.Timer;
let timer: NodeJS.Timeout;
let lastRan = 0;

return (...args) => {
if (!lastRan) {
func.apply(null, args);
lastRan = Date.now();
} else {
clearTimeout(timer);
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(() => {
if (Date.now() - lastRan >= wait) {
func.apply(null, args);
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const CONTAINER_WIDTH = 363;
interface ICustomBrowserWindow extends Electron.BrowserWindow {
winName: string;
notificationData: INotificationData;
displayTimer: NodeJS.Timer;
displayTimer: NodeJS.Timeout;
clientId: number;
}

Expand Down Expand Up @@ -75,7 +75,7 @@ class Notification extends NotificationHandler {
};
private activeNotifications: ICustomBrowserWindow[] = [];
private inactiveWindows: ICustomBrowserWindow[] = [];
private cleanUpTimer: NodeJS.Timer;
private cleanUpTimer: NodeJS.Timeout;
private notificationQueue: INotificationData[] = [];

private readonly notificationCallbacks: any[] = [];
Expand Down

0 comments on commit 45b9141

Please sign in to comment.