mirror of
https://github.com/Stefan-5422/-T5-Elektrifikatsiya.git
synced 2026-09-04 00:45:58 +02:00
Toggle Fix
This commit is contained in:
@@ -139,10 +139,13 @@
|
|||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
ListView<Device> deviceList = new ListView<Device>();
|
||||||
List<Device> plugs = new List<Device>();
|
List<Device> plugs = new List<Device>();
|
||||||
|
|
||||||
bool hideButtonSettings = true;
|
bool hideButtonSettings = true;
|
||||||
|
|
||||||
|
int clicks = 0;
|
||||||
|
|
||||||
double electricityPrice = 0;
|
double electricityPrice = 0;
|
||||||
|
|
||||||
Device? SelectedDevice = null;
|
Device? SelectedDevice = null;
|
||||||
@@ -162,9 +165,18 @@
|
|||||||
|
|
||||||
private void Toggle(Device device)
|
private void Toggle(Device device)
|
||||||
{
|
{
|
||||||
hideButtonSettings = !hideButtonSettings;
|
if (device == SelectedDevice || clicks == 0)
|
||||||
SelectedDevice = device;
|
{
|
||||||
DeviceCopy = device.CopyDevice();
|
hideButtonSettings = !hideButtonSettings;
|
||||||
|
SelectedDevice = device;
|
||||||
|
DeviceCopy = device.CopyDevice();
|
||||||
|
clicks++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SelectedDevice = device;
|
||||||
|
DeviceCopy = device.CopyDevice();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnSave()
|
private async void OnSave()
|
||||||
|
|||||||
@@ -10,11 +10,10 @@
|
|||||||
"User": "<SMTP_USER>",
|
"User": "<SMTP_USER>",
|
||||||
"Key": "<SMTP_KEY>",
|
"Key": "<SMTP_KEY>",
|
||||||
"DefaultEmail": "SMTP_EMAIL_ADDRESS",
|
"DefaultEmail": "SMTP_EMAIL_ADDRESS",
|
||||||
"DefaultEmail": "<SMTP_EMAIL_ADDRESS>",
|
|
||||||
"Templates": {
|
"Templates": {
|
||||||
"DailyNotification": "../assets/DailyNotif.html"
|
"DailyNotification": "../assets/DailyNotif.html"
|
||||||
},
|
},
|
||||||
"SmtpServer": "<SMTP_SERVER>",
|
"SmtpServer": "<SMTP_SERVER>",
|
||||||
"SmtpPort": <SMTP_PORT>
|
"SmtpPort": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user