mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Create entry history only if DB is open
Fix issues in entry field names Entry field names cleanup and refactoring
This commit is contained in:
@@ -248,15 +248,6 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
|
||||
switch (fieldName)
|
||||
{
|
||||
case EntryFieldName.Title:
|
||||
case EntryFieldName.UserName:
|
||||
case EntryFieldName.Password:
|
||||
case EntryFieldName.Notes:
|
||||
case EntryFieldName.Url:
|
||||
var stringValue = fieldValue == null ? string.Empty: fieldValue.ToString();
|
||||
var unprotectedFieldValue = isProtected ? await _cryptography.UnProtect(stringValue) : stringValue;
|
||||
pwEntry.Strings.Set(EntryFieldMapper.MapFieldToPwDef(fieldName), new ProtectedString(isProtected, unprotectedFieldValue));
|
||||
break;
|
||||
case EntryFieldName.HasExpirationDate:
|
||||
pwEntry.Expires = (bool)fieldValue;
|
||||
break;
|
||||
@@ -273,9 +264,9 @@ namespace ModernKeePass.Infrastructure.KeePass
|
||||
pwEntry.ForegroundColor = (Color)fieldValue;
|
||||
break;
|
||||
default:
|
||||
var additionalStringValue = fieldValue == null ? string.Empty: fieldValue.ToString();
|
||||
var unprotectedAdditionalFieldValue = isProtected ? await _cryptography.UnProtect(additionalStringValue) : additionalStringValue;
|
||||
pwEntry.Strings.Set(fieldName, new ProtectedString(isProtected, unprotectedAdditionalFieldValue));
|
||||
var stringValue = fieldValue == null ? string.Empty: fieldValue.ToString();
|
||||
var unprotectedFieldValue = isProtected ? await _cryptography.UnProtect(stringValue) : stringValue;
|
||||
pwEntry.Strings.Set(fieldName, new ProtectedString(isProtected, unprotectedFieldValue));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user