save settings with password confirmation

This commit is contained in:
Simon Vieille
2025-04-14 22:44:00 +02:00
parent 31b330451c
commit b98bbd1053
2 changed files with 52 additions and 17 deletions
+26
View File
@@ -0,0 +1,26 @@
const waitPasswordConfirmation = async () => {
let tries = 0
return new Promise((resolve, reject) => {
const execute = () => {
if (!OC.PasswordConfirmation.requiresPasswordConfirmation()) {
resolve()
return
}
OC.PasswordConfirmation.requirePasswordConfirmation(() => {})
if (++tries !== 10) {
setTimeout(() => {
execute()
}, 2000)
} else {
reject()
}
}
execute()
})
}
export { waitPasswordConfirmation }