mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 22:15:38 -05:00
@@ -869,4 +869,22 @@ Singleton {
|
||||
getState()
|
||||
}
|
||||
}
|
||||
|
||||
function setWifiAutoconnect(ssid, autoconnect) {
|
||||
if (!networkAvailable || DMSService.apiVersion <= 13) return
|
||||
|
||||
const params = {
|
||||
ssid: ssid,
|
||||
autoconnect: autoconnect
|
||||
}
|
||||
|
||||
DMSService.sendRequest("network.wifi.setAutoconnect", params, response => {
|
||||
if (response.error) {
|
||||
ToastService.showError(I18n.tr("Failed to update autoconnect"))
|
||||
} else {
|
||||
ToastService.showInfo(autoconnect ? I18n.tr("Autoconnect enabled") : I18n.tr("Autoconnect disabled"))
|
||||
Qt.callLater(() => getState())
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,4 +283,10 @@ Singleton {
|
||||
activeService.cancelCredentials(token)
|
||||
}
|
||||
}
|
||||
|
||||
function setWifiAutoconnect(ssid, autoconnect) {
|
||||
if (activeService && activeService.setWifiAutoconnect) {
|
||||
activeService.setWifiAutoconnect(ssid, autoconnect)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user