mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
fix(environment): clear computed property cache after adding environment variables
- Added cache clearing for environment variables and their preview after a new variable is added to ensure the UI reflects the latest data. - Updated the refreshEnvs method to include cache clearing, enhancing the responsiveness of the environment variable display.
This commit is contained in:
parent
70d0ae2b33
commit
eb1f16b62e
1 changed files with 9 additions and 0 deletions
|
|
@ -212,6 +212,12 @@ class All extends Component
|
|||
$environment = $this->createEnvironmentVariable($data);
|
||||
$environment->order = $maxOrder + 1;
|
||||
$environment->save();
|
||||
|
||||
// Clear computed property cache to force refresh
|
||||
unset($this->environmentVariables);
|
||||
unset($this->environmentVariablesPreview);
|
||||
|
||||
$this->dispatch('success', 'Environment variable added.');
|
||||
}
|
||||
|
||||
private function createEnvironmentVariable($data)
|
||||
|
|
@ -300,6 +306,9 @@ class All extends Component
|
|||
public function refreshEnvs()
|
||||
{
|
||||
$this->resource->refresh();
|
||||
// Clear computed property cache to force refresh
|
||||
unset($this->environmentVariables);
|
||||
unset($this->environmentVariablesPreview);
|
||||
$this->getDevView();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue