Bug fixes and encryption handling
This commit is contained in:
@@ -436,7 +436,6 @@ Note.get = (userId, noteId, password = '') => {
|
||||
|
||||
//To many attempts in less than 5 minutes, note is locked
|
||||
if(noteData.decrypt_attempts_count > 3 && timeSinceLastUnlock < 300){
|
||||
console.log('Locked Out')
|
||||
noteLockedOut = true
|
||||
}
|
||||
|
||||
@@ -444,7 +443,6 @@ Note.get = (userId, noteId, password = '') => {
|
||||
if(noteData.decrypt_attempts_count > 0 && timeSinceLastUnlock > 300){
|
||||
noteLockedOut = false
|
||||
noteData.decrypt_attempts_count = 0
|
||||
console.log('Resseting Lockout')
|
||||
db.promise().query('UPDATE note_raw_text SET last_decrypted_date = ?, decrypt_attempts_count = 0 WHERE id = ?', [nowTime, rawTextId ])
|
||||
}
|
||||
}
|
||||
@@ -628,8 +626,10 @@ Note.search = (userId, searchQuery, searchTags, fastFilters) => {
|
||||
searchAllNotes = true
|
||||
}
|
||||
|
||||
//Encrypted Note
|
||||
if(fastFilters.onlyShowEncrypted == 1){
|
||||
noteSearchQuery += ' AND encrypted = 1'
|
||||
searchAllNotes = true
|
||||
}
|
||||
|
||||
//If tags are passed, use those tags in search
|
||||
|
@@ -23,6 +23,10 @@ Tag.userTags = (userId, searchQuery, searchTags, fastFilters) => {
|
||||
query += ' AND note.share_user_id IS NULL'
|
||||
}
|
||||
|
||||
if(fastFilters && fastFilters.onlyShowEncrypted == 1){
|
||||
query += ' AND note.encrypted = 1' //Show Archived
|
||||
}
|
||||
|
||||
//Show archived notes, only if fast filter is set, default to not archived
|
||||
if(fastFilters && fastFilters.onlyArchived == 1){
|
||||
query += ' AND note.archived = 1' //Show Archived
|
||||
|
Reference in New Issue
Block a user