feat: do not make splash screen wait for checkForUpdates task (#1390)
This commit is contained in:
parent
a0178ebab9
commit
80ca6bf177
@ -34,13 +34,12 @@ namespace hex::init {
|
|||||||
|
|
||||||
using namespace std::literals::string_literals;
|
using namespace std::literals::string_literals;
|
||||||
|
|
||||||
static bool checkForUpdates() {
|
static bool checkForUpdatesSync() {
|
||||||
int checkForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.server_contact", 2);
|
int checkForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.server_contact", 2);
|
||||||
|
|
||||||
// Check if we should check for updates
|
// Check if we should check for updates
|
||||||
if (checkForUpdates == 1){
|
if (checkForUpdates == 1){
|
||||||
HttpRequest request("GET", GitHubApiURL + "/releases/latest"s);
|
HttpRequest request("GET", GitHubApiURL + "/releases/latest"s);
|
||||||
request.setTimeout(500);
|
|
||||||
|
|
||||||
// Query the GitHub API for the latest release version
|
// Query the GitHub API for the latest release version
|
||||||
auto response = request.execute().get();
|
auto response = request.execute().get();
|
||||||
@ -112,6 +111,11 @@ namespace hex::init {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool checkForUpdates() {
|
||||||
|
TaskManager::createBackgroundTask("Checking for updates", [](auto&) { checkForUpdatesSync(); });
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool setupEnvironment() {
|
bool setupEnvironment() {
|
||||||
hex::log::debug("Using romfs: '{}'", romfs::name());
|
hex::log::debug("Using romfs: '{}'", romfs::name());
|
||||||
@ -608,7 +612,7 @@ namespace hex::init {
|
|||||||
{ "Loading settings", loadSettings, false },
|
{ "Loading settings", loadSettings, false },
|
||||||
{ "Configuring UI scale", configureUIScale, false },
|
{ "Configuring UI scale", configureUIScale, false },
|
||||||
{ "Loading plugins", loadPlugins, true },
|
{ "Loading plugins", loadPlugins, true },
|
||||||
{ "Checking for updates", checkForUpdates, true },
|
{ "Checking for updates", checkForUpdates, false },
|
||||||
{ "Loading fonts", loadFonts, true },
|
{ "Loading fonts", loadFonts, true },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user