Fix logic of the 'Newer' autosave indicator

This commit is contained in:
2025-03-28 11:10:21 -05:00
parent ecf0227cc3
commit 9e67aa09ce

View File

@@ -1991,12 +1991,13 @@ class cFilePicker {
auto_folder.replace_extension(".auto"); auto_folder.replace_extension(".auto");
if(fs::is_directory(auto_folder)) auto_mtimes = sorted_file_mtimes(auto_folder); if(fs::is_directory(auto_folder)) auto_mtimes = sorted_file_mtimes(auto_folder);
} }
me["auto" + suffix + "-more-recent"].hide();
if(auto_mtimes.empty()){ if(auto_mtimes.empty()){
me["auto" + suffix].hide(); me["auto" + suffix].hide();
me["auto" + suffix + "-more-recent"].hide();
}else{ }else{
// If an autosave is newer than the main save, show an indicator // If an autosave is newer than the main save, show an indicator
if(std::difftime(mtime, auto_mtimes.front().second) > 0) if(std::difftime(mtime, auto_mtimes.front().second) < 0)
me["auto" + suffix + "-more-recent"].show(); me["auto" + suffix + "-more-recent"].show();
me["auto" + suffix].attachClickHandler(std::bind(&cFilePicker::showAuto, this, auto_folder)); me["auto" + suffix].attachClickHandler(std::bind(&cFilePicker::showAuto, this, auto_folder));