Bug fixes and encryption handling

This commit is contained in:
Max G
2020-03-14 06:04:03 +00:00
parent ca0b649ff6
commit 342ac95282
4 changed files with 31 additions and 15 deletions

View File

@@ -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

View File

@@ -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