fixed bugs related to action buttons
This commit is contained in:
@@ -92,8 +92,14 @@ class Aria2Controller extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (in_array($action, ['removeDownloadResult', 'remove'])) {
|
if (in_array($action, ['removeDownloadResult', 'remove'])) {
|
||||||
if (isset($resp['result']) && strtolower($resp['result']) === 'ok') {
|
$result = $resp['result'] ?? null;
|
||||||
return ['message' => $this->l10n->t("DONE!"), 'status' => 1];
|
if (isset($result)) {
|
||||||
|
if (strtolower($result) === 'ok') {
|
||||||
|
return ['message' => $this->l10n->t("DONE!"), 'status' => 1];
|
||||||
|
}
|
||||||
|
if (is_string($result)) {
|
||||||
|
return ['message' => $this->l10n->t($result), 'status' => 1];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return ['error' => $this->l10n->t("FAILED!"), 'status' => 0];
|
return ['error' => $this->l10n->t("FAILED!"), 'status' => 0];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user