Trim the created tag to account for user errors
This commit is contained in:
parent
67c99c9c42
commit
cbbb3bbf72
@ -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()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user