mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 09:51:21 -06:00
Divide by zero.
This commit is contained in:
parent
d287ae97f8
commit
85f484e73c
@ -179,11 +179,16 @@ class ImportController extends Controller
|
||||
'stepsDone' => $job->extended_status['steps_done'],
|
||||
'statusText' => trans('firefly.import_status_' . $job->status),
|
||||
];
|
||||
$percentage = 0;
|
||||
if ($job->extended_status['total_steps'] !== 0) {
|
||||
$percentage = round(($job->extended_status['steps_done'] / $job->extended_status['total_steps']) * 100, 0);
|
||||
}
|
||||
|
||||
if ($job->status === 'import_running') {
|
||||
$result['started'] = true;
|
||||
$result['running'] = true;
|
||||
$result['showPercentage'] = true;
|
||||
$result['percentage'] = round(($job->extended_status['steps_done'] / $job->extended_status['total_steps']) * 100, 0);
|
||||
$result['percentage'] = $percentage;
|
||||
}
|
||||
|
||||
return Response::json($result);
|
||||
|
Loading…
Reference in New Issue
Block a user