@@ -51,7 +51,6 @@ static func save_svg_as() -> void:
5151 _save_svg_as_with_custom_final_callback (Callable ())
5252
5353static func open_export_dialog (export_data : ImageExportData , final_callback := Callable ()) -> void :
54- OS .request_permissions ()
5554 if OS .has_feature ("web" ):
5655 var web_format_name := ImageExportData .web_formats [export_data .format ]
5756 if export_data .format == "svg" :
@@ -88,7 +87,8 @@ static func open_export_dialog(export_data: ImageExportData, final_callback := C
8887 export_dialog .file_selected .connect (non_native_callback )
8988
9089static func open_xml_export_dialog (xml : String , file_name : String ) -> void :
91- OS .request_permissions ()
90+ if not OS .request_permissions ():
91+ return
9292 if OS .has_feature ("web" ):
9393 _web_save (xml .to_utf8_buffer (), "application/xml" )
9494 else :
@@ -158,11 +158,11 @@ static func open_image_import_dialog(completion_callback: Callable) -> void:
158158static func open_xml_import_dialog (completion_callback : Callable ) -> void :
159159 _open_import_dialog (PackedStringArray (["xml" ]), completion_callback )
160160
161-
162161# On web, the completion callback can't use the full file path,
163162static func _open_import_dialog (extensions : PackedStringArray ,
164163completion_callback : Callable , native_dialog_title := "" ) -> void :
165- OS .request_permissions ()
164+ if not OS .request_permissions ():
165+ return
166166 var extensions_with_dots := PackedStringArray ()
167167 for extension in extensions :
168168 extensions_with_dots .append ("." + extension )
0 commit comments