fix: modrinth categories not loading
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
7523bc1925
commit
9b07c6948c
2 changed files with 4 additions and 3 deletions
|
@ -150,11 +150,11 @@ std::unique_ptr<ModFilterWidget> ModrinthModPage::createFilterWidget()
|
|||
void ModrinthModPage::prepareProviderCategories()
|
||||
{
|
||||
auto response = std::make_shared<QByteArray>();
|
||||
auto task = ModrinthAPI::getModCategories(response);
|
||||
QObject::connect(task.get(), &Task::succeeded, [this, response]() {
|
||||
m_categoriesTask = ModrinthAPI::getModCategories(response);
|
||||
QObject::connect(m_categoriesTask.get(), &Task::succeeded, [this, response]() {
|
||||
auto categories = ModrinthAPI::loadModCategories(response);
|
||||
m_filter_widget->setCategories(categories);
|
||||
});
|
||||
task->start();
|
||||
m_categoriesTask->start();
|
||||
};
|
||||
} // namespace ResourceDownload
|
||||
|
|
|
@ -98,6 +98,7 @@ class ModrinthModPage : public ModPage {
|
|||
|
||||
protected:
|
||||
virtual void prepareProviderCategories() override;
|
||||
Task::Ptr m_categoriesTask;
|
||||
};
|
||||
|
||||
class ModrinthResourcePackPage : public ResourcePackResourcePage {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue