mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Make sure number of steps is always correct.
This commit is contained in:
@@ -187,6 +187,12 @@ class FileConfigurator implements ConfiguratorInterface
|
||||
$this->repository = app(ImportJobRepositoryInterface::class);
|
||||
$this->repository->setUser($job->user);
|
||||
|
||||
// set number of steps to 100:
|
||||
$extendedStatus = $this->getExtendedStatus();
|
||||
$extendedStatus['steps'] = 6;
|
||||
$extendedStatus['done'] = 0;
|
||||
$this->setExtendedStatus($extendedStatus);
|
||||
|
||||
$config = $this->getConfig();
|
||||
$newConfig = array_merge($this->defaultConfig, $config);
|
||||
$this->repository->setConfiguration($job, $newConfig);
|
||||
@@ -241,4 +247,24 @@ class FileConfigurator implements ConfiguratorInterface
|
||||
|
||||
return $class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function getExtendedStatus(): array
|
||||
{
|
||||
return $this->repository->getExtendedStatus($this->job);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shorthand method.
|
||||
*
|
||||
* @param array $extended
|
||||
*/
|
||||
private function setExtendedStatus(array $extended): void
|
||||
{
|
||||
$this->repository->setExtendedStatus($this->job, $extended);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user