Skip to content

Commit

Permalink
fix: small fix in the case of a missing settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
Totto16 committed Oct 31, 2024
1 parent f6974a4 commit f7c0a22
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/manager/settings_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ SettingsManager::SettingsManager(ServiceProvider* service_provider) : m_service_
if (result.has_value()) {
m_settings = result.value();
} else {
spdlog::error("unable to load settings from \"{}\": {}", detail::settings_filename, result.error());
spdlog::warn("unable to load settings from \"{}\": {}", detail::settings_filename, result.error());
spdlog::warn("applying default settings");

m_settings = {
detail::Settings{ {}, std::nullopt, 1.0, false }
detail::Settings{ .controls = {}, .selected = std::nullopt, .volume = 1.0, .discord = false }
};

//TODO(Totto): save the file, if it doesn't exist, if it has an error, just leave it there
}
}

Expand Down

0 comments on commit f7c0a22

Please sign in to comment.