From deb7a2d094661a4c314e7b3d26e7c4f527a9b805 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Mon, 31 Mar 2025 15:44:08 +1100 Subject: [PATCH] update comments --- Session/Meta/AppDelegate.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Session/Meta/AppDelegate.swift b/Session/Meta/AppDelegate.swift index 602d15abe..28abcc310 100644 --- a/Session/Meta/AppDelegate.swift +++ b/Session/Meta/AppDelegate.swift @@ -133,9 +133,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } ) - /// Adding this to prevent new users who only installed Session after this update being asked for local network access on first startup. - /// Because the only way we can check the status of local network permission will trigger the system prompt to ask for the permission. - /// It won't affect anything after the user has enabled the calls permission and gone through the permission chain after that. + /// Adding this to prevent new users being asked for local network permission in the wrong order in the permission chain. + /// We need to check the local nework permission status every time the app is activated to refresh the UI in Settings screen. + /// And after granting or denying a system permission request will trigger the local nework permission status check in applicationDidBecomeActive(:) + /// The only way we can check the status of local network permission will trigger the system prompt to ask for the permission. + /// So we need this to keep it the correct order of the permission chain. + /// For users who already enabled the calls permission and made calls, the local network permission should already be asked for. + /// It won't affect anything. dependencies[defaults: .standard, key: .hasRequestedLocalNetworkPermission] = dependencies[singleton: .storage, key: .areCallsEnabled] /// Now that the theme settings have been applied we can complete the migrations