Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ignoring expired entries on auto-load using local time #399

Merged
merged 1 commit into from
Dec 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion KeeAgent/KeeAgentExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ private void MainForm_FileOpened(object sender, FileOpenedEventArgs e)
return;
}

var dtNow = DateTime.UtcNow;
foreach (var entry in e.Database.RootGroup.GetEntries(true)) {
if (e.Database.RecycleBinEnabled) {
var recycleBin = e.Database.RootGroup.FindGroup(e.Database.RecycleBinUuid, true);
Expand All @@ -916,7 +917,7 @@ private void MainForm_FileOpened(object sender, FileOpenedEventArgs e)
}
}

if (entry.Expires && entry.ExpiryTime <= DateTime.Now
if (entry.Expires && entry.ExpiryTime <= dtNow
&& !e.Database.GetKeeAgentSettings().AllowAutoLoadExpiredEntryKey) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion KeeAgent/UI/EntryPickerDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void InitalizeList(bool autodetect)
{
mCustomTreeViewEx.BeginUpdate();
mCustomTreeViewEx.Nodes.Clear();
mCachedNow = DateTime.Now;
mCachedNow = DateTime.UtcNow;
bool entriesFound = false;

foreach (var db in ext.pluginHost.MainWindow.DocumentManager.GetOpenDatabases()) {
Expand Down