Extensions: use the modal update when enabling the repository

This allows the user to cancel the update by pressing escape.
This commit is contained in:
Campbell Barton 2024-05-16 16:59:16 +10:00
parent af996db23a
commit d91e6f7b14

@ -2275,8 +2275,10 @@ class BlPkgOnlineAccess(Operator):
self.report({'WARNING'}, "Repository \"{:s}\" not found!".format(remote_url))
# Run the first check for updates automatically.
if bpy.ops.bl_pkg.repo_sync_all.poll():
bpy.ops.bl_pkg.repo_sync_all()
# Invoke the modal operator so users can cancel by pressing "Escape".
assert bpy.ops.bl_pkg.repo_sync_all.poll()
bpy.ops.bl_pkg.repo_sync_all('INVOKE_DEFAULT')
prefs.extensions.use_online_access_handled = True
return {'FINISHED'}