Skip to content
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

RTC-13903 backport 23.4 #1777

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/app/c9-shell-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class C9ShellHandler {
private _c9shell: ChildProcess | undefined;
private _curStatus: IShellStatus | undefined;
private _isDisconnected = false;
private _isFreshStart = true;
private _isStarting = false;
private _isTerminating = false;
private _sender: WebContents;
Expand Down Expand Up @@ -195,6 +196,7 @@ class C9ShellHandler {
);

this._updateStatus({ status: 'starting' });
this._isFreshStart = true;
const c9Shell = spawn(c9ShellPath, customC9ShellArgList, { stdio: 'pipe' });

c9Shell.on('close', (code) => {
Expand Down Expand Up @@ -234,10 +236,11 @@ class C9ShellHandler {
* @param c9ShellMessage Any message provided by c9-shell
*/
private _updateNetworkStatus(c9ShellMessage: string) {
if (this._isDisconnected) {
if (
c9ShellMessage.includes('NetworkConnectivityService|Internet Available')
) {
if (
c9ShellMessage.includes('NetworkConnectivityService|Internet Available')
) {
this._isFreshStart = false;
if (this._isDisconnected) {
this._isDisconnected = false;
this._onNetworkReconnection();
}
Expand All @@ -246,7 +249,7 @@ class C9ShellHandler {
'NetworkConnectivityService|No Internet Available',
)
) {
this._isDisconnected = true;
this._isDisconnected = !this._isFreshStart;
}
}

Expand Down