diff --git a/CHANGELOG.md b/CHANGELOG.md index 8227a15d..e81e8763 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,5 +8,6 @@ - Minor: Removed "Online Logs" functionality as services are shut down (#1640) - Bugfix: Fix preview on hover not working when Animated emotes options was disabled (#1546) - Bugfix: FFZ custom mod badges no longer scale with the emote scale options (#1602) +- Bugfix: MacOS updater looked for non-existing fields, causing it to always fail the update check (#1642) - Settings open faster - Dev: Fully remove Twitch Chatroom support diff --git a/src/singletons/Updates.cpp b/src/singletons/Updates.cpp index 8f105498..3b6ca327 100644 --- a/src/singletons/Updates.cpp +++ b/src/singletons/Updates.cpp @@ -259,7 +259,7 @@ void Updates::checkForUpdates() } #if defined Q_OS_WIN || defined Q_OS_MACOS - /// Windows downloads an installer for the new version + /// Downloads an installer for the new version QJsonValue updateExe_val = object.value("updateexe"); if (!updateExe_val.isString()) { @@ -268,7 +268,8 @@ void Updates::checkForUpdates() return Failure; } this->updateExe_ = updateExe_val.toString(); - +#endif +#ifdef Q_OS_WIN /// Windows portable QJsonValue portable_val = object.value("portable_download"); if (!portable_val.isString()) @@ -278,14 +279,15 @@ void Updates::checkForUpdates() return Failure; } this->updatePortable_ = portable_val.toString(); - -#elif defined Q_OS_LINUX +#endif +#ifdef Q_OS_LINUX QJsonValue updateGuide_val = object.value("updateguide"); if (updateGuide_val.isString()) { this->updateGuideLink_ = updateGuide_val.toString(); } -#else +#endif +#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) && !defined(Q_OS_LINUX) return Failure; #endif diff --git a/src/util/InitUpdateButton.cpp b/src/util/InitUpdateButton.cpp index 826c8feb..4c1de6b8 100644 --- a/src/util/InitUpdateButton.cpp +++ b/src/util/InitUpdateButton.cpp @@ -14,8 +14,17 @@ void initUpdateButton(Button &button, QObject::connect(&button, &Button::leftClicked, [&button] { auto dialog = new UpdateDialog(); dialog->setActionOnFocusLoss(BaseWindow::Delete); - dialog->move(button.mapToGlobal( - QPoint(int(-100 * button.scale()), button.height()))); + + auto globalPoint = button.mapToGlobal( + QPoint(int(-100 * button.scale()), button.height())); + + // Make sure that update dialog will not go off left edge of screen + if (globalPoint.x() < 0) + { + globalPoint.setX(0); + } + + dialog->move(globalPoint); dialog->show(); dialog->raise();