Is there an API which allows an app to query the state of the local network access permission (i.e. to check whether the user has granted the permission or not)?
Querying the state of local network access permission
NWBrowser/nwbrowsert also provides a .waiting state with an error whenever the user has denied local network access.