Skip to content

Commit

Permalink
avoid requesting user to evalute after app reboots after using camera
Browse files Browse the repository at this point in the history
  • Loading branch information
jfoclpf committed Jun 10, 2023
1 parent 7688299 commit b671f95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion www/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ app.main = (function (thisModule) {

// request user to evaluate this app on Play Store
function requestUserAppEvaluation () {
if (JSON.parse(window.localStorage.getItem('didUserAlreadyClickedToEvaluatedApp'))) {
if (
JSON.parse(window.localStorage.getItem('didUserAlreadyClickedToEvaluatedApp')) ||
JSON.parse(window.localStorage.getItem('isUserUsingCamera'))
) {
return
}

Expand Down
4 changes: 3 additions & 1 deletion www/js/photos.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ app.photos = (function (thisModule) {
console.log('Has permission to use CAMERA')

// store for the case when the app reboots, see function onAppResumeAfterReboot
window.localStorage.setItem('isUserUsingCamera', JSON.stringify(true))
window.localStorage.setItem('userCapturingPhotoNumber', imgNmbr.toString())
window.localStorage.setItem('userCapturingPhotoType', type)

const options = setCameraOptions(type)

console.log('starting navigator.camera.getPicture')
navigator.camera.getPicture(function (result) {
console.log('cameraSuccess init')
console.log('%c Camera Success', 'color: green; font-weight:bold')
window.localStorage.setItem('isUserUsingCamera', JSON.stringify(false))
cameraSuccess(result, imgNmbr, type, callback)
},
function cameraError (error) {
Expand Down

0 comments on commit b671f95

Please sign in to comment.