iOS camera issue when using HTMLInputElement of type file

We have the ability to attach files in our app using a hidden HTMLInputElement with type of file that gives the ability to select a file in the apps generated for Windows and Android. The app for iOS however also gives you the option to “Take a picture or video”. If the user clicks on that, the camera app opens and then the camera permission prompt is displayed. If the user for some reason selects “Deny” the camera app remains open and allows the user to take a picture or video and attaches it. If the user goes to attach another file after denying camera permission, the option for “Take a picture or video” is still available and if the user selects it the camera app opens, but the user cannot actually take a picture or video, they can only cancel out of the camera app. What needs to be done to not have “Take a picture or video” option available after the user has denied permission to the camera?