Skip to content

Commit

Permalink
Do not show empty braces in tray item if username was not set (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidik committed Apr 5, 2020
1 parent 1cedfca commit d469f57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion KeeTrayTOTP/TrayTOTP_Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ private void OnNotifyMenuOpening(object sender, CancelEventArgs e)
var context = new SprContext(entry, PluginHost.MainWindow.ActiveDatabase, SprCompileFlags.All, false, false);
var entryUsername = SprEngine.Compile(entry.Strings.ReadSafe(PwDefs.UserNameField), context);
string trayTitle;
if (trimTrayText && entryTitle.Length + entryUsername.Length > setstat_trim_text_length)
if ((trimTrayText && entryTitle.Length + entryUsername.Length > setstat_trim_text_length) || (string.IsNullOrEmpty(entryUsername)))
{
trayTitle = entryTitle.ExtWithSpaceAfter();
}
Expand Down

0 comments on commit d469f57

Please sign in to comment.