mirror of
https://github.com/everoddandeven/monerod-gui.git
synced 2024-12-22 19:49:27 +00:00
Minor fixes
Some checks are pending
Lint Test / build (20) (push) Waiting to run
MacOS Build / build (20) (push) Waiting to run
MacOS 12 - x64 DMG Build / build (20) (push) Waiting to run
Ubuntu 22.04 - AppImage Build / build (20) (push) Waiting to run
Ubuntu 22.04 - x64 DEB Build / build (20) (push) Waiting to run
Ubuntu 24.04 - x64 DEB Build / build (20) (push) Waiting to run
Windows Build / build (20) (push) Waiting to run
Some checks are pending
Lint Test / build (20) (push) Waiting to run
MacOS Build / build (20) (push) Waiting to run
MacOS 12 - x64 DMG Build / build (20) (push) Waiting to run
Ubuntu 22.04 - AppImage Build / build (20) (push) Waiting to run
Ubuntu 22.04 - x64 DEB Build / build (20) (push) Waiting to run
Ubuntu 24.04 - x64 DEB Build / build (20) (push) Waiting to run
Windows Build / build (20) (push) Waiting to run
This commit is contained in:
parent
25656f5fba
commit
3333beec5e
2 changed files with 26 additions and 15 deletions
34
app/main.ts
34
app/main.ts
|
@ -306,22 +306,28 @@ const createSplashWindow = async (): Promise<BrowserWindow | undefined> => {
|
||||||
// #region WiFi
|
// #region WiFi
|
||||||
|
|
||||||
function isConnectedToWiFi(): Promise<boolean> {
|
function isConnectedToWiFi(): Promise<boolean> {
|
||||||
return new Promise<boolean>((resolve, reject) => {
|
try {
|
||||||
network.get_active_interface((err: any | null, obj: { name: string, ip_address: string, mac_address: string, type: string, netmask: string, gateway_ip: string }) => {
|
|
||||||
if (err) {
|
return new Promise<boolean>((resolve, reject) => {
|
||||||
console.error("Errore durante il controllo della connessione Wi-Fi:", err);
|
network.get_active_interface((err: any | null, obj: { name: string, ip_address: string, mac_address: string, type: string, netmask: string, gateway_ip: string }) => {
|
||||||
reject(err);
|
if (err) {
|
||||||
}
|
console.error("Errore durante il controllo della connessione Wi-Fi:", err);
|
||||||
else {
|
reject(err);
|
||||||
console.log('isConnectedToWifi:');
|
}
|
||||||
console.log(obj);
|
else {
|
||||||
resolve(obj.type == 'Wireless');
|
console.log('isConnectedToWifi:');
|
||||||
}
|
console.log(obj);
|
||||||
})
|
resolve(obj.type == 'Wireless');
|
||||||
});
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch(error: any) {
|
||||||
|
return isConnectedToWiFiV2();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isConnectedToWiFiOld(): Promise<boolean> {
|
function isConnectedToWiFiV2(): Promise<boolean> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const platform = os.platform(); // Use os to get the platform
|
const platform = os.platform(); // Use os to get the platform
|
||||||
|
|
||||||
|
|
|
@ -330,13 +330,18 @@ export class DaemonDataService {
|
||||||
public syncDisabledByWifiPolicy: boolean = false;
|
public syncDisabledByWifiPolicy: boolean = false;
|
||||||
public syncDisabledByPeriodPolicy: boolean = false;
|
public syncDisabledByPeriodPolicy: boolean = false;
|
||||||
|
|
||||||
|
private osType?: { platform: string };
|
||||||
|
|
||||||
private async refresh(): Promise<void> {
|
private async refresh(): Promise<void> {
|
||||||
if (this.refreshing || this.tooEarlyForRefresh || this.daemonService.stopping) {
|
if (this.refreshing || this.tooEarlyForRefresh || this.daemonService.stopping) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._runningOnBattery === undefined) {
|
if (this.osType === undefined) {
|
||||||
|
this.osType = await this.electronService.getOsType();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._runningOnBattery === undefined || this.osType.platform == 'linux') {
|
||||||
this._runningOnBattery = await this.electronService.isOnBatteryPower();
|
this._runningOnBattery = await this.electronService.isOnBatteryPower();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue