Ensure we reset the task states if taskId is gone

This commit is contained in:
Johannes Zellner
2025-01-05 16:40:04 +01:00
parent 98ba214dfb
commit 6da071c88d
+2 -3
View File
@@ -100,15 +100,14 @@ function create(origin, accessToken, id) {
for (const app of result.body.apps) {
app.ssoAuth = app.sso && (app.manifest.addons['ldap'] || app.manifest.addons['oidc'] || app.manifest.addons['proxyAuth']); // checking app.sso first ensures app.manifest.addons is not null
if (app.accessLevel !== 'operator' && app.accessLevel !== 'admin') { // only fetch if we have permissions
// only fetch if we have permissions and a taskId is set/active
if (!app.taskId || (app.accessLevel !== 'operator' && app.accessLevel !== 'admin')) {
app.progress = 0;
app.message = '';
app.taskMinutesActive = 0;
continue;
}
if (!app.taskId) continue;
const task = await getTask(app.id);
if (task) {
app.progress = task.percent;