mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibGUI: Don't show "last saved" information for never-saved documents
When showing the "unsaved changes" dialog for an empty path, we should say "last saved at ..." since that would be a lie.
This commit is contained in:
@@ -37,7 +37,7 @@ int MessageBox::ask_about_unsaved_changes(Window* parent_window, StringView path
|
||||
builder.appendff("\"{}\"", LexicalPath::basename(path));
|
||||
builder.append(" before closing?");
|
||||
|
||||
if (last_unmodified_timestamp.has_value()) {
|
||||
if (!path.is_empty() && last_unmodified_timestamp.has_value()) {
|
||||
auto age = (Time::now_monotonic() - *last_unmodified_timestamp).to_seconds();
|
||||
builder.appendff("\nLast saved {} second{} ago.", age, age == 1 ? "" : "s");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user