Skip to content

Commit

Permalink
Fixes: Anthias is not starting asset (gets stuck at the logo screen) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nicomiguelino authored Jul 28, 2024
1 parent ec8115b commit 4bd295c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions webview/src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ void View::loadImage(const QString &preUri)

QUrl url;
url.setScheme("http");
// url.setHost(qgetenv("LISTEN"));
url.setHost("anthias-nginx");
url.setPath("/screenly_assets/" + fileInfo.fileName());

Expand All @@ -62,10 +61,15 @@ void View::loadImage(const QString &preUri)

stop();
pre_loader -> setHtml("<html><head><script>" + script + "</script></head><body style='" + styles + "'><script>window.setimg(\"" + src + "\");</script></body></html>");
connect(pre_loader,SIGNAL(loadFinished(bool)),&pre_loader_loop,SLOT(quit()));
QTimer::singleShot(5000, &pre_loader_loop, SLOT(quit()));
pre_loader_loop.exec();
pre_loader -> toHtml([&](const QString &result){ setHtml(result); });

connect(pre_loader, &QWebEnginePage::loadFinished, this, [=](bool result){
if (result)
{
pre_loader -> toHtml([&](const QString &result){
setHtml(result);
});
}
});
}

void View::handleAuthRequest(QNetworkReply* reply, QAuthenticator* auth)
Expand Down

0 comments on commit 4bd295c

Please sign in to comment.