Skip to content

Commit

Permalink
fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Jun 13, 2022
1 parent a5e3657 commit bfd7537
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
6 changes: 2 additions & 4 deletions apps/meteor/app/apps/server/communication/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import { AppServerOrchestrator } from '../orchestrator';

const waitToLoad = function (orch: AppServerOrchestrator): unknown {
return new Promise<void>((resolve) => {
let id = setInterval(() => {
const id = setInterval(() => {
if (orch.isEnabled() && orch.isLoaded()) {
clearInterval(id);
id = -1 as unknown as NodeJS.Timeout;
resolve();
}
}, 100);
Expand All @@ -20,10 +19,9 @@ const waitToLoad = function (orch: AppServerOrchestrator): unknown {

const waitToUnload = function (orch: AppServerOrchestrator): unknown {
return new Promise<void>((resolve) => {
let id = setInterval(() => {
const id = setInterval(() => {
if (!orch.isEnabled() && !orch.isLoaded()) {
clearInterval(id);
id = -1 as unknown as NodeJS.Timeout;
resolve();
}
}, 100);
Expand Down
24 changes: 12 additions & 12 deletions apps/meteor/app/apps/server/communication/websockets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import { SystemLogger } from '../../../../server/lib/logger/system';
import notifications from '../../../notifications/server/lib/Notifications';
import { AppServerOrchestrator } from '../orchestrator';

export const AppEvents = Object.freeze({
APP_ADDED: 'app/added',
APP_REMOVED: 'app/removed',
APP_UPDATED: 'app/updated',
APP_STATUS_CHANGE: 'app/statusUpdate',
APP_SETTING_UPDATED: 'app/settingUpdated',
COMMAND_ADDED: 'command/added',
COMMAND_DISABLED: 'command/disabled',
COMMAND_UPDATED: 'command/updated',
COMMAND_REMOVED: 'command/removed',
ACTIONS_CHANGED: 'actions/changed',
});
export enum AppEvents {
APP_ADDED = 'app/added',
APP_REMOVED = 'app/removed',
APP_UPDATED = 'app/updated',
APP_STATUS_CHANGE = 'app/statusUpdate',
APP_SETTING_UPDATED = 'app/settingUpdated',
COMMAND_ADDED = 'command/added',
COMMAND_DISABLED = 'command/disabled',
COMMAND_UPDATED = 'command/updated',
COMMAND_REMOVED = 'command/removed',
ACTIONS_CHANGED = 'actions/changed',
}

export class AppServerListener {
private orch: AppServerOrchestrator;
Expand Down

0 comments on commit bfd7537

Please sign in to comment.