fix(service): ensure configuration changes are properly tracked and dispatched

This commit is contained in:
Andras Bacsai
2025-07-03 15:08:13 +02:00
parent b181e5bb33
commit 13a9816770
3 changed files with 3 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ class StartService
StopService::run(service: $service, dockerCleanup: false); StopService::run(service: $service, dockerCleanup: false);
} }
$service->saveComposeConfigs(); $service->saveComposeConfigs();
$service->isConfigurationChanged(save: true);
$commands[] = 'cd '.$service->workdir(); $commands[] = 'cd '.$service->workdir();
$commands[] = "echo 'Saved configuration files to {$service->workdir()}.'"; $commands[] = "echo 'Saved configuration files to {$service->workdir()}.'";
if ($pullLatestImages) { if ($pullLatestImages) {

View File

@@ -63,7 +63,7 @@ class Heading extends Component
$this->service->databases->each(function ($database) { $this->service->databases->each(function ($database) {
$database->refresh(); $database->refresh();
}); });
if (is_null($this->service->config_hash) || $this->service->isConfigurationChanged()) { if (is_null($this->service->config_hash)) {
$this->service->isConfigurationChanged(true); $this->service->isConfigurationChanged(true);
} }
$this->dispatch('configurationChanged'); $this->dispatch('configurationChanged');

View File

@@ -170,6 +170,7 @@ class Show extends Component
$this->syncData(true); $this->syncData(true);
$this->dispatch('success', 'Environment variable updated.'); $this->dispatch('success', 'Environment variable updated.');
$this->dispatch('envsUpdated'); $this->dispatch('envsUpdated');
$this->dispatch('configurationChanged');
} catch (\Exception $e) { } catch (\Exception $e) {
return handleError($e); return handleError($e);
} }