|
|
@ -24,7 +24,6 @@ class BookSourceEditViewModel(application: Application) : BaseViewModel(applicat |
|
|
|
fun save(bookSource: BookSource, finally: (() -> Unit)? = null) { |
|
|
|
fun save(bookSource: BookSource, finally: (() -> Unit)? = null) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
sourceLiveData.value?.let { |
|
|
|
sourceLiveData.value?.let { |
|
|
|
bookSource.customOrder = it.customOrder |
|
|
|
|
|
|
|
App.db.bookSourceDao().delete(it) |
|
|
|
App.db.bookSourceDao().delete(it) |
|
|
|
} ?: let { |
|
|
|
} ?: let { |
|
|
|
bookSource.customOrder = App.db.bookSourceDao().maxOrder + 1 |
|
|
|
bookSource.customOrder = App.db.bookSourceDao().maxOrder + 1 |
|
|
|