Disallow editing of secret keys
This commit is contained in:
@@ -1048,12 +1048,15 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
_serverConfigurationManager.Save();
|
_serverConfigurationManager.Save();
|
||||||
}
|
}
|
||||||
var key = item.Value.Key;
|
var key = item.Value.Key;
|
||||||
|
var keyInUse = selectedServer.Authentications.Exists(p => p.SecretKeyIdx == item.Key);
|
||||||
|
if (keyInUse) ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudGrey3);
|
||||||
if (ImGui.InputText("Secret Key", ref key, 64))
|
if (ImGui.InputText("Secret Key", ref key, 64))
|
||||||
{
|
{
|
||||||
item.Value.Key = key;
|
item.Value.Key = key;
|
||||||
_serverConfigurationManager.Save();
|
_serverConfigurationManager.Save();
|
||||||
}
|
}
|
||||||
if (!selectedServer.Authentications.Exists(p => p.SecretKeyIdx == item.Key))
|
if (keyInUse) ImGui.PopStyleColor();
|
||||||
|
if (!keyInUse)
|
||||||
{
|
{
|
||||||
if (UiSharedService.NormalizedIconTextButton(FontAwesomeIcon.Trash, "Delete Secret Key") && UiSharedService.CtrlPressed())
|
if (UiSharedService.NormalizedIconTextButton(FontAwesomeIcon.Trash, "Delete Secret Key") && UiSharedService.CtrlPressed())
|
||||||
{
|
{
|
||||||
@@ -1064,7 +1067,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UiSharedService.ColorTextWrapped("This key is in use and cannot be deleted", ImGuiColors.DalamudYellow);
|
UiSharedService.ColorTextWrapped("This key is in use and cannot be edited or deleted", ImGuiColors.DalamudYellow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.Key != selectedServer.SecretKeys.Keys.LastOrDefault())
|
if (item.Key != selectedServer.SecretKeys.Keys.LastOrDefault())
|
||||||
|
|||||||
Reference in New Issue
Block a user