Fix the update notification

This commit is contained in:
Maschell 2024-02-24 14:19:25 +01:00
parent 0e726dfbb2
commit 346db1466e
2 changed files with 7 additions and 7 deletions

View File

@ -33,7 +33,7 @@ void ShowHints() {
const char *tmp_file = "fs:/vol/external01/wiiu/write_lock"; const char *tmp_file = "fs:/vol/external01/wiiu/write_lock";
int fd = -1; int fd = -1;
if ((fd = open(tmp_file, O_CREAT | O_TRUNC | O_RDWR)) < 0) { if ((fd = open(tmp_file, O_CREAT | O_TRUNC | O_RDWR)) < 0) {
DEBUG_FUNCTION_LINE_VERBOSE("SD Card mounted but not writable"); DEBUG_FUNCTION_LINE_WARN("SD Card mounted but not writable. errno: %d", errno);
NotificationModuleStatus err; NotificationModuleStatus err;
NMColor red = {237, 28, 36, 255}; NMColor red = {237, 28, 36, 255};
NotificationModuleHandle outHandle; NotificationModuleHandle outHandle;

View File

@ -57,7 +57,7 @@ bool saveLatestUpdateHash(const std::string &hash) {
} }
if (WUPSStorageAPI::SaveStorage() != WUPS_STORAGE_ERROR_SUCCESS) { if (WUPSStorageAPI::SaveStorage() != WUPS_STORAGE_ERROR_SUCCESS) {
DEBUG_FUNCTION_LINE_ERR("Failed to save strorage"); DEBUG_FUNCTION_LINE_ERR("Failed to save storage");
return false; return false;
} }
@ -88,7 +88,11 @@ void UpdateCheckThreadEntry() {
AromaUpdater::LatestVersion data = nlohmann::json::parse(outBuffer); AromaUpdater::LatestVersion data = nlohmann::json::parse(outBuffer);
gUpdateChecked = true; gUpdateChecked = true;
if (gLastHash == data.getHash()) { if (gLastHash.empty()) { // don't show update warning on first boot
gLastHash = data.getHash();
} else if (gLastHash != data.getHash()) {
ShowUpdateNotification();
} else if (gLastHash == data.getHash()) {
DEBUG_FUNCTION_LINE_VERBOSE("We don't need to update the hash"); DEBUG_FUNCTION_LINE_VERBOSE("We don't need to update the hash");
return; return;
} }
@ -96,10 +100,6 @@ void UpdateCheckThreadEntry() {
// Update hash // Update hash
gLastHash = data.getHash(); gLastHash = data.getHash();
if (!gLastHash.empty()) { // don't show update warning on first boot
ShowUpdateNotification();
}
saveLatestUpdateHash(gLastHash); saveLatestUpdateHash(gLastHash);
} catch (std::exception &e) { } catch (std::exception &e) {
DEBUG_FUNCTION_LINE_WARN("Failed to parse AromaUpdater::LatestVersion"); DEBUG_FUNCTION_LINE_WARN("Failed to parse AromaUpdater::LatestVersion");