Trim the created tag to account for user errors

This commit is contained in:
Jobobby04 2020-09-16 13:00:39 -04:00
parent 67c99c9c42
commit cbbb3bbf72

View File

@ -56,14 +56,14 @@ class SortTagPresenter : BasePresenter<SortTagController>() {
*/ */
fun createTag(name: String) { fun createTag(name: String) {
// Do not allow duplicate categories. // Do not allow duplicate categories.
if (tagExists(name)) { if (tagExists(name.trim())) {
Observable.just(Unit).subscribeFirst({ view, _ -> view.onTagExistsError() }) Observable.just(Unit).subscribeFirst({ view, _ -> view.onTagExistsError() })
return return
} }
val size = preferences.sortTagsForLibrary().get().size val size = preferences.sortTagsForLibrary().get().size
preferences.sortTagsForLibrary() += "$size|$name" preferences.sortTagsForLibrary() += "$size|${name.trim()}"
} }
/** /**