Skip to content

Commit

Permalink
Merge pull request #3825 from CruGlobal/GT-2197-Fix-changing-language…
Browse files Browse the repository at this point in the history
…s-in-cyoa-tool

GT-2197 Fix CYOA tools closing when changing languages
  • Loading branch information
frett authored Dec 18, 2024
2 parents ccea724 + 367a601 commit 578a82d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import androidx.annotation.LayoutRes
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.activityViewModels
import androidx.lifecycle.asLiveData
import androidx.lifecycle.map
import javax.inject.Inject
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.map
import org.ccci.gto.android.common.androidx.fragment.app.findListener
import org.ccci.gto.android.common.androidx.lifecycle.notNull
Expand Down Expand Up @@ -62,7 +62,7 @@ abstract class CyoaPageFragment<B : ViewDataBinding, C : BaseController<*>>(@Lay
// region Page
internal var pageId by arg<String>()
private set
internal val page by lazy { dataModel.manifest.map { it?.findPage(pageId) }.asLiveData() }
internal val page by lazy { dataModel.manifest.filterNotNull().map { it.findPage(pageId) }.asLiveData() }

init {
page?.let { pageId = page }
Expand Down

0 comments on commit 578a82d

Please sign in to comment.