mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09: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:
parent
219339d2a5
commit
0c09617b48
Notes:
sideshowbarker
2024-07-17 21:40:02 +09:00
Author: https://github.com/awesomekling
Commit: 0c09617b48
1 changed files with 1 additions and 1 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue