1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-10 10:00:44 +09:00

When navigating to a document via search-screen, open this new document without passing by dashboard-screen (#844)

This commit is contained in:
Evgenii Kozlov 2020-09-12 21:21:53 +02:00 committed by GitHub
parent 080a310540
commit be8dd22bd0
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 19 deletions

View file

@ -16,7 +16,10 @@ interface AppNavigation {
fun chooseAccount()
fun workspace()
fun openProfile()
fun openDocument(id: String, editorSettings: EditorSettings?)
fun launchDocument(id: String)
fun startDesktopFromSplash()
fun startDesktopFromLogin()
fun startSplashFromDesktop()
@ -55,7 +58,10 @@ interface AppNavigation {
object SelectAccountScreen : Command()
object EnterKeyChainScreen : Command()
object WorkspaceScreen : Command()
data class OpenPage(val id: String, val editorSettings: EditorSettings? = null) : Command()
data class LaunchDocument(val id: String) : Command()
object OpenProfile : Command()
object OpenKeychainScreen : Command()
object OpenPinCodeScreen : Command()

View file

@ -26,6 +26,7 @@ class PageSearchViewModel(
MutableLiveData()
fun onViewCreated() {
links.clear()
stateData.postValue(PageSearchView.Init)
}
@ -66,6 +67,6 @@ class PageSearchViewModel(
}
fun onOpenPageClicked(pageId: String) {
navigate(EventWrapper(AppNavigation.Command.ExitToDesktopAndOpenPage(pageId = pageId)))
navigate(EventWrapper(AppNavigation.Command.LaunchDocument(id = pageId)))
}
}

View file

@ -477,7 +477,7 @@ class BlockReadModeTest : PageViewModelTest() {
}
@Test
fun `should show error after action menu is closed by action item move to`() {
fun `should not show error after action menu is closed by action item move to`() {
val paragraphs = blocks
stubObserveEvents(flow)
@ -501,6 +501,6 @@ class BlockReadModeTest : PageViewModelTest() {
val testObserver = vm.error.test()
testObserver.assertValue("Move To not implemented")
testObserver.assertNoValue()
}
}