File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
app/src/main/kotlin/dev/chungjungsoo/gptmobile/presentation/ui Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class MainViewModel @Inject constructor(private val settingRepository: SettingRe
3232 viewModelScope.launch {
3333 val platforms = settingRepository.fetchPlatforms()
3434
35- if (platforms.all { it.token == null || it.model == null }) {
35+ if (platforms.all { it.enabled. not () }) {
3636 // Initialize
3737 sendSplashEvent(SplashEvent .OpenIntro )
3838 } else {
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ class SetupViewModel @Inject constructor(private val settingRepository: SettingR
118118 Route .OLLAMA_API_ADDRESS ,
119119 Route .SETUP_COMPLETE
120120 )
121- val commonSteps = setOf (Route .SELECT_PLATFORM , Route .TOKEN_INPUT , Route .SETUP_COMPLETE )
121+ val commonSteps = mutableSetOf (Route .SELECT_PLATFORM , Route .TOKEN_INPUT , Route .SETUP_COMPLETE )
122122 val platformStep = mapOf (
123123 Route .OPENAI_MODEL_SELECT to ApiType .OPENAI ,
124124 Route .ANTHROPIC_MODEL_SELECT to ApiType .ANTHROPIC ,
@@ -129,6 +129,12 @@ class SetupViewModel @Inject constructor(private val settingRepository: SettingR
129129
130130 val currentIndex = steps.indexOfFirst { it == currentRoute }
131131 val enabledPlatform = platformState.value.filter { it.selected }.map { it.name }.toSet()
132+
133+ if (enabledPlatform.size == 1 && ApiType .OLLAMA in enabledPlatform) {
134+ // Skip API Token input page
135+ commonSteps.remove(Route .TOKEN_INPUT )
136+ }
137+
132138 val remainingSteps = steps.filterIndexed { index, setupStep ->
133139 index > currentIndex &&
134140 (setupStep in commonSteps || platformStep[setupStep] in enabledPlatform)
You can’t perform that action at this time.
0 commit comments