Skip to content

Commit

Permalink
Do not save empty search query
Browse files Browse the repository at this point in the history
  • Loading branch information
cemrich committed Feb 10, 2024
1 parent 55b0366 commit 1ea5a61
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class SearchRepository(private val database: Database) {
}

suspend fun saveQuery(query: String) = withContext(Dispatchers.IO) {
if (query.trim() == "") {
return@withContext
}

database
.searchDao()
.saveQuery(SearchQuery(query, DateTime.now()))
Expand Down

0 comments on commit 1ea5a61

Please sign in to comment.