mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-22 21:58:53 +01:00
Clean up MainViewModel
This commit is contained in:
@@ -38,39 +38,20 @@ class MainViewModel : QkViewModel<MainView, MainState>(MainState()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
intents += view.inboxIntent.subscribe {
|
intents += view.inboxIntent.subscribe {
|
||||||
newState {
|
val adapter = ConversationsAdapter(messageRepo.getConversationMessagesAsync())
|
||||||
it.copy(
|
newState { it.copy(page = MainPage.INBOX, adapter = adapter, drawerOpen = false) }
|
||||||
page = MainPage.INBOX,
|
|
||||||
adapter = ConversationsAdapter(messageRepo.getConversationMessagesAsync()),
|
|
||||||
drawerOpen = false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intents += view.archivedIntent.subscribe {
|
intents += view.archivedIntent.subscribe {
|
||||||
newState {
|
newState { it.copy(page = MainPage.ARCHIVED, adapter = null, drawerOpen = false) }
|
||||||
it.copy(
|
|
||||||
page = MainPage.ARCHIVED,
|
|
||||||
adapter = null,
|
|
||||||
drawerOpen = false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intents += view.scheduledIntent.subscribe {
|
intents += view.scheduledIntent.subscribe {
|
||||||
newState {
|
newState { it.copy(page = MainPage.SCHEDULED, adapter = null, drawerOpen = false) }
|
||||||
it.copy(
|
|
||||||
page = MainPage.SCHEDULED,
|
|
||||||
adapter = null,
|
|
||||||
drawerOpen = false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intents += view.blockedIntent.subscribe {
|
intents += view.blockedIntent.subscribe {
|
||||||
newState {
|
newState { it.copy(page = MainPage.BLOCKED, adapter = null, drawerOpen = false) }
|
||||||
it.copy(
|
|
||||||
page = MainPage.BLOCKED,
|
|
||||||
adapter = null,
|
|
||||||
drawerOpen = false)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intents += view.settingsIntent.subscribe {
|
intents += view.settingsIntent.subscribe {
|
||||||
|
|||||||
Reference in New Issue
Block a user