mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-05 03:36:35 +00:00
Merge pull request #112 from bcmi-labs/GH-240
GH-240: Warn if not connected to the Internet
This commit is contained in:
commit
f71a266fe3
@ -157,6 +157,10 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
|
||||
|
||||
@postConstruct()
|
||||
protected async init(): Promise<void> {
|
||||
if (!window.navigator.onLine) {
|
||||
// tslint:disable-next-line:max-line-length
|
||||
this.messageService.warn('You appear to be offline. Without an Internet connection, the Arduino CLI might not be able to download the required resources and could cause malfunction. Please connect to the Internet and restart the application.');
|
||||
}
|
||||
const updateStatusBar = (config: BoardsConfig.Config) => {
|
||||
this.statusBar.setElement('arduino-selected-board', {
|
||||
alignment: StatusBarAlignment.RIGHT,
|
||||
|
@ -38,14 +38,12 @@ export class CoreClientProvider extends GrpcClientProvider<CoreClientProvider.Cl
|
||||
const client = new ArduinoCoreClient(`localhost:${port}`, grpc.credentials.createInsecure(), this.channelOptions);
|
||||
const initReq = new InitReq();
|
||||
initReq.setLibraryManagerOnly(false);
|
||||
const initResp = await new Promise<InitResp>(resolve => {
|
||||
const initResp = await new Promise<InitResp>((resolve, reject) => {
|
||||
let resp: InitResp | undefined = undefined;
|
||||
const stream = client.init(initReq);
|
||||
stream.on('data', (data: InitResp) => resp = data);
|
||||
stream.on('end', () => resolve(resp));
|
||||
stream.on('error', err => {
|
||||
console.log('init error', err)
|
||||
});
|
||||
stream.on('error', err => reject(err));
|
||||
});
|
||||
|
||||
const instance = initResp.getInstance();
|
||||
|
@ -8,7 +8,7 @@
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@theia/cli": "next",
|
||||
"lerna": "^3.13.3",
|
||||
"lerna": "^3.20.2",
|
||||
"rimraf": "^2.6.1",
|
||||
"tslint": "^5.5.0",
|
||||
"typescript": "3.5.1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user