Fix variable indicators not updating when active environment is deleted
This commit is contained in:
parent
1a35867871
commit
56e294debb
@ -1255,6 +1255,7 @@ class RequestTabWidget(Gtk.Box):
|
|||||||
# Set flag to indicate we're programmatically changing the dropdown
|
# Set flag to indicate we're programmatically changing the dropdown
|
||||||
# This prevents the signal handler from triggering indicator updates during initialization
|
# This prevents the signal handler from triggering indicator updates during initialization
|
||||||
self._is_programmatically_changing_environment = True
|
self._is_programmatically_changing_environment = True
|
||||||
|
old_env_id = self.selected_environment_id
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Build string list with "None" + environment names
|
# Build string list with "None" + environment names
|
||||||
@ -1276,6 +1277,8 @@ class RequestTabWidget(Gtk.Box):
|
|||||||
index = self.environment_ids.index(self.selected_environment_id)
|
index = self.environment_ids.index(self.selected_environment_id)
|
||||||
self.environment_dropdown.set_selected(index)
|
self.environment_dropdown.set_selected(index)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
# Previously selected environment no longer exists
|
||||||
|
self.selected_environment_id = None
|
||||||
self.environment_dropdown.set_selected(0) # Default to "None"
|
self.environment_dropdown.set_selected(0) # Default to "None"
|
||||||
else:
|
else:
|
||||||
self.environment_dropdown.set_selected(0) # Default to "None"
|
self.environment_dropdown.set_selected(0) # Default to "None"
|
||||||
@ -1284,8 +1287,9 @@ class RequestTabWidget(Gtk.Box):
|
|||||||
# Always clear the flag
|
# Always clear the flag
|
||||||
self._is_programmatically_changing_environment = False
|
self._is_programmatically_changing_environment = False
|
||||||
|
|
||||||
# Note: Don't update indicators here as the request might not be loaded yet
|
# If the effective environment changed (e.g. was deleted), update indicators
|
||||||
# Indicators will be updated when environment changes or request is loaded
|
if self.selected_environment_id != old_env_id:
|
||||||
|
self._update_variable_indicators()
|
||||||
|
|
||||||
def _show_environment_selector(self):
|
def _show_environment_selector(self):
|
||||||
"""Show environment selector (create if it doesn't exist)."""
|
"""Show environment selector (create if it doesn't exist)."""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user