Commit 0c034528 authored by gbyte.co's avatar gbyte.co

Round progress bar percentage

parent 7a2028c7
......@@ -58,7 +58,7 @@ class SimplesitemapSettingsForm extends SimplesitemapFormBase {
$total_count = $queue_worker->getInitialElementCount();
$index_progress = [
'#theme' => 'progress_bar',
'#percent' => $total_count ? (100 * $indexed_count / $total_count) : 100,
'#percent' => round(100 * $indexed_count / $total_count),
'#message' => t('@indexed out of @total items have been indexed.', ['@indexed' => $indexed_count, '@total' => $total_count]),
];
$form['simple_sitemap_settings']['progress'] = [
......
......@@ -313,7 +313,7 @@ class QueueWorker {
if ($this->state->has('simple_sitemap.queue_stashed_results')) {
$results = $this->state->get('simple_sitemap.queue_stashed_results');
$this->state->delete('simple_sitemap.queue_stashed_results');
$this->results = is_array($results['results']) ? $results['results'] : [];
$this->results = !empty($results['results']) ? $results['results'] : [];
$this->variantProcessedNow = $results['variant'];
$this->generatorProcessedNow = $results['generator'];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment