8000 [WIP]: Theia 1.27.0 signed by kittaakos · Pull Request #1241 · arduino/arduino-ide · GitHub
[go: up one dir, main page]

Skip to content

[WIP]: Theia 1.27.0 signed #1241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
debounced the connectivity status update
do not run it on every incomming request but before timeout expires.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta committed Jul 22, 2022
commit ead325a0a6dcec4c2b921ddc4557c9bf6ffe461e
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
import { ArduinoDaemon } from '../../../common/protocol';
import { NotificationCenter } from '../../notification-center';
import { nls } from '@theia/core/lib/common';
import debounce = require('lodash.debounce');

@injectable()
export class FrontendConnectionStatusService extends TheiaFrontendConnectionStatusService {
Expand All @@ -36,10 +37,11 @@ export class FrontendConnectionStatusService extends TheiaFrontendConnectionStat
this.notificationCenter.onDaemonDidStop(
() => (this.connectedPort = undefined)
);
this.wsConnectionProvider.onIncomingMessageActivity(() => {
const refresh = debounce(() => {
this.updateStatus(!!this.connectedPort);
this.schedulePing();
});
}, this.options.offlineTimeout - 10);
this.wsConnectionProvider.onIncomingMessageActivity(() => refresh());
}
}

Expand Down
0