Updated password functions. Returns to albums when pressing cancel.

This commit is contained in:
Tobias Reich 2016-03-06 20:34:44 +01:00
parent 0096e2769f
commit a60b4cc454

View File

@ -9,7 +9,7 @@ password = {
} }
password.get = function(albumID, callback, passwd) { password.get = function(albumID, callback) {
if (lychee.publicMode===false) callback() if (lychee.publicMode===false) callback()
else if (album.json && album.json.password==='0') callback() else if (album.json && album.json.password==='0') callback()
@ -17,18 +17,25 @@ password.get = function(albumID, callback, passwd) {
else if (!albums.json && !album.json) { else if (!albums.json && !album.json) {
// Continue without password // Continue without password
album.json = { password: true } album.json = { password: true }
callback('') callback('')
} else if (passwd==null) { } else {
// Request password // Request password
password.getDialog(albumID, callback) password.getDialog(albumID, callback)
} else { }
// Check password }
password.getDialog = function(albumID, callback) {
const action = (data) => {
let passwd = data.password
let params = { let params = {
albumID, albumID,
@ -49,16 +56,10 @@ password.get = function(albumID, callback, passwd) {
} }
}
password.getDialog = function(albumID, callback) {
const action = (data) => password.get(albumID, callback, data.password)
const cancel = () => { const cancel = () => {
basicModal.close() basicModal.close()
if (visible.albums()===false) lychee.goto() if (!visible.albums()) lychee.goto()
} }