save settings with password confirmation
This commit is contained in:
@@ -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 }
|
||||
Reference in New Issue
Block a user