Fix export button crash for saved requests by using async callback
This commit is contained in:
parent
8ad720afc8
commit
4a8776a42d
@ -1183,9 +1183,8 @@ class RosterWindow(Adw.ApplicationWindow):
|
||||
return
|
||||
|
||||
# Apply variable substitution if environment is selected
|
||||
substituted_request = request
|
||||
if widget.selected_environment_id:
|
||||
env = widget.get_selected_environment()
|
||||
def show_export(env):
|
||||
substituted_request = request
|
||||
if env:
|
||||
from .variable_substitution import VariableSubstitution
|
||||
substituted_request, undefined = VariableSubstitution.substitute_request(request, env)
|
||||
@ -1196,10 +1195,15 @@ class RosterWindow(Adw.ApplicationWindow):
|
||||
# Show warning toast but continue with export
|
||||
self._show_toast(f"Warning: {len(undefined)} undefined variable(s)")
|
||||
|
||||
# Show export dialog with substituted request
|
||||
from .export_dialog import ExportDialog
|
||||
dialog = ExportDialog(substituted_request)
|
||||
dialog.present(self)
|
||||
# Show export dialog with substituted request
|
||||
from .export_dialog import ExportDialog
|
||||
dialog = ExportDialog(substituted_request)
|
||||
dialog.present(self)
|
||||
|
||||
if widget.selected_environment_id:
|
||||
widget.get_selected_environment(show_export)
|
||||
else:
|
||||
show_export(None)
|
||||
|
||||
def _mark_tab_as_saved(self, saved_request_id, name, request, scripts=None):
|
||||
"""Mark the current tab as saved (clear modified flag)."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user