|
|
|
@ -61,8 +61,13 @@ export class ApiService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public checkOnline(): Promise<boolean> {
|
|
|
|
|
return fetch(this.statUrl).then(resp => {
|
|
|
|
|
return resp && (resp.ok || resp.type === 'opaque');
|
|
|
|
|
return new Promise(res => {
|
|
|
|
|
fetch(this.statUrl).then(resp => {
|
|
|
|
|
res(resp && (resp.ok || resp.type === 'opaque'));
|
|
|
|
|
}).catch(e => {
|
|
|
|
|
console.error('Check Online Error', e);
|
|
|
|
|
res(false);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|