Skip to content

Commit aeb9fe0

Browse files
ComputerEliteComputerElite
authored andcommitted
Make grant access button check if app is installed instead of restore app data button
1 parent f91be94 commit aeb9fe0

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

QuestAppVersionSwitcher/Assets/html/script.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -695,19 +695,29 @@ document.getElementById("install").onclick = () => {
695695
}
696696

697697
document.getElementById("grantAccess").onclick = () => {
698-
fetch("grantaccess?package=" + config.currentApp).then(res => {
698+
fetch("android/ispackageinstalled?package=" + config.currentApp).then(res => {
699699
res.text().then(text => {
700-
if (res.status == 200) {
701-
fetch("containsgamedata?package=" + config.currentApp + "&backupname=" + selectedBackup).then(res => {
700+
if (text == "True") {
701+
fetch("grantaccess?package=" + config.currentApp).then(res => {
702702
res.text().then(text => {
703-
if (text == "False") {
704-
GotoStep(5)
705-
} else {
706-
GotoStep(4)
707-
}
703+
if (res.status == 200) {
704+
fetch("containsgamedata?package=" + config.currentApp + "&backupname=" + selectedBackup).then(res => {
705+
res.text().then(text => {
706+
if (text == "False") {
707+
GotoStep(5)
708+
} else {
709+
GotoStep(4)
710+
}
711+
})
712+
})
713+
} else TextBoxError("step3box", text)
708714
})
709715
})
710-
} else TextBoxError("step3box", text)
716+
}
717+
else {
718+
TextBoxError("step3box", config.currentApp + " is not installed. Please try again. Disable library sharing and remove all account from your quest except your primary one.")
719+
GotoStep(3)
720+
}
711721
})
712722
})
713723
}

0 commit comments

Comments
 (0)