Skip to content

Commit

Permalink
fix: more fixes in Desktop Timer
Browse files Browse the repository at this point in the history
  • Loading branch information
evereq committed Mar 30, 2024
1 parent 44924b8 commit 1583d5f
Show file tree
Hide file tree
Showing 21 changed files with 548 additions and 309 deletions.
3 changes: 2 additions & 1 deletion apps/desktop-timer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"sqlite3": "^5.1.7",
"squirrelly": "^8.0.8",
"twing": "^5.0.2",
"underscore": "^1.13.3"
"underscore": "^1.13.3",
"undici": "^6.10.2"
},
"optionalDependencies": {
"node-linux": "^0.1.12",
Expand Down
3 changes: 2 additions & 1 deletion apps/desktop-timer/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
"squirrelly": "^8.0.8",
"tslib": "^2.3.0",
"twing": "^5.0.2",
"underscore": "^1.13.3"
"underscore": "^1.13.3",
"undici": "^6.10.2"
}
}
4 changes: 3 additions & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"moment-duration-format": "^2.3.2",
"moment-range": "^4.0.2",
"moment-timezone": "^0.5.40",
"node-fetch": "^2.6.7",
"node-static": "^0.7.11",
"pg": "^8.11.3",
"pg-query-stream": "^4.5.3",
Expand All @@ -86,7 +87,8 @@
"sqlite3": "^5.1.7",
"squirrelly": "^8.0.8",
"twing": "^5.0.2",
"typeorm": "^0.3.20"
"typeorm": "^0.3.20",
"undici": "^6.10.2"
},
"optionalDependencies": {
"node-linux": "^0.1.12",
Expand Down
3 changes: 2 additions & 1 deletion apps/desktop/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@
"underscore": "^1.13.3",
"screenshot-desktop": "^1.12.7",
"mac-screen-capture-permissions": "^2.0.0",
"embedded-queue": "^0.0.11"
"embedded-queue": "^0.0.11",
"undici": "^6.10.2"
},
"optionalDependencies": {
"node-linux": "^0.1.12",
Expand Down
55 changes: 30 additions & 25 deletions apps/gauzy/src/app/@core/services/server-connection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,42 @@ export class ServerConnectionService {
const url = `${endPoint}/api`;

return new Promise((resolve, reject) => {
console.log(`Checking server connection on URL in ServerConnectionService in @core/services: ${url}`);

try {
console.log(`Checking server connection on URL in ServerConnectionService in @core/services: ${url}`);
if (endPoint !== 'http://localhost:3000') {
const requestObservable = this.httpClient.get(url);

const requestObservable = this.httpClient.get(url);
if (!requestObservable) {
console.error('Failed to create an Observable from the HTTP request.');
reject('Failed to create an Observable from the HTTP request.');
return;
}

if (!requestObservable) {
console.error('Failed to create an Observable from the HTTP request.');
reject('Failed to create an Observable from the HTTP request.');
return;
requestObservable.subscribe({
next: (resp: any) => {
console.log(
`Server connection status in ServerConnectionService for URL ${url} is: ${resp.status}`
);
this.store.serverConnection = resp.status;
resolve(true);
},
error: (err) => {
console.error(
`Error checking server connection in ServerConnectionService for URL ${url}`,
err
);
this.store.serverConnection = err.status;
reject(err);
}
});
} else {
console.log(`Skip checking server connection for URL ${url}`);
resolve(true);
}

requestObservable.subscribe({
next: (resp: any) => {
console.log(
`Server connection status in ServerConnectionService for URL ${url} is: ${resp.status}`
);
this.store.serverConnection = resp.status;
resolve(true);
},
error: (err) => {
console.error(
`Error checking server connection in ServerConnectionService for URL ${url}`,
err
);
this.store.serverConnection = err.status;
reject();
}
});
} catch (error) {
console.error(`Error checking server connection in ServerConnectionService for URL ${url}`, error);
reject();
reject(error);
}
});
}
Expand Down
4 changes: 3 additions & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@
"moment-range": "^4.0.2",
"moment-timezone": "^0.5.40",
"node-static": "^0.7.11",
"node-fetch": "^2.6.7",
"pg": "^8.11.3",
"pg-query-stream": "^4.5.3",
"rxjs": "^7.4.0",
"sqlite3": "^5.1.7",
"squirrelly": "^8.0.8",
"twing": "^5.0.2",
"typeorm": "^0.3.20"
"typeorm": "^0.3.20",
"undici": "^6.10.2"
},
"optionalDependencies": {
"node-linux": "^0.1.12",
Expand Down
3 changes: 2 additions & 1 deletion apps/server/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@
"squirrelly": "^8.0.8",
"tslib": "^2.3.0",
"twing": "^5.0.2",
"underscore": "^1.13.3"
"underscore": "^1.13.3",
"undici": "^6.10.2"
},
"optionalDependencies": {
"node-linux": "^0.1.12",
Expand Down
3 changes: 2 additions & 1 deletion packages/desktop-libs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"screenshot-desktop": "^1.12.7",
"sound-play": "1.1.0",
"sqlite3": "^5.1.7",
"underscore": "^1.13.3"
"underscore": "^1.13.3",
"undici": "^6.10.2"
},
"devDependencies": {
"@types/node": "^17.0.33",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { INetworkState } from '../interfaces';

export class NetworkStateManager {
private _state: INetworkState;

constructor(state?: INetworkState) {
this._state = state;
}

public set state(value: INetworkState) {
this._state = value;
}
Expand Down
Loading

0 comments on commit 1583d5f

Please sign in to comment.