mirror of
https://github.com/everoddandeven/monerod-gui.git
synced 2025-01-08 20:09:44 +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
|
@ -306,6 +306,8 @@ const createSplashWindow = async (): Promise<BrowserWindow | undefined> => {
|
||||||
// #region WiFi
|
// #region WiFi
|
||||||
|
|
||||||
function isConnectedToWiFi(): Promise<boolean> {
|
function isConnectedToWiFi(): Promise<boolean> {
|
||||||
|
try {
|
||||||
|
|
||||||
return new Promise<boolean>((resolve, reject) => {
|
return new Promise<boolean>((resolve, reject) => {
|
||||||
network.get_active_interface((err: any | null, obj: { name: string, ip_address: string, mac_address: string, type: string, netmask: string, gateway_ip: string }) => {
|
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) {
|
if (err) {
|
||||||
|
@ -319,9 +321,13 @@ function isConnectedToWiFi(): Promise<boolean> {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
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