impr: Only auto backup if there's something to backup

This commit is contained in:
WerWolv 2023-12-22 21:16:09 +01:00
parent b934ca6ad3
commit ec64952cb4
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ namespace hex::plugin::builtin {
if (autoBackupTime > 0 && (now - lastBackupTime) > std::chrono::seconds(autoBackupTime)) {
lastBackupTime = now;
if (ImHexApi::Provider::isValid()) {
if (ImHexApi::Provider::isValid() && ImHexApi::Provider::isDirty()) {
for (const auto &path : fs::getDefaultPaths(fs::ImHexPath::Backups)) {
const auto fileName = hex::format("auto_backup.{:%y%m%d_%H%M%S}.hexproj", fmt::gmtime(std::chrono::system_clock::now()));
if (ProjectFile::store(path / fileName, false))