File tree Expand file tree Collapse file tree
legacyLibreDebug/res/values
legacyLibreRelease/res/values
kotlin/app/fyreplace/fyreplace/legacy/grpc Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,17 +54,17 @@ object GrpcModule {
5454 val environment = preferences.getEnvironment(context)
5555 val localEnvironment = context.getString(R .string.settings_environment_local_value)
5656 val isLocal = environment == localEnvironment
57- val hostRes = when (environment) {
58- context.getString(R .string.settings_environment_main_value) -> R .string.api_host_main
59- context.getString(R .string.settings_environment_dev_value) -> R .string.api_host_dev
60- localEnvironment -> R .string.api_host_local
61- else -> R .string.api_host_default
57+ val ( hostRes, portRes) = when (environment) {
58+ context.getString(R .string.settings_environment_main_value) -> R .string.api_host_main to R .integer.api_port_main
59+ context.getString(R .string.settings_environment_dev_value) -> R .string.api_host_dev to R .integer.api_port_dev
60+ localEnvironment -> R .string.api_host_local to R .integer.api_port_local
61+ else -> throw RuntimeException ( " Invalid environment " )
6262 }
6363
6464 val serverUrl = HttpUrl .Builder ()
6565 .scheme(if (isLocal) " http" else " https" )
6666 .host(context.resources.getString(hostRes))
67- .port(context.resources.getInteger(R .integer.api_port ))
67+ .port(context.resources.getInteger(portRes ))
6868 .build()
6969
7070 return GrpcClient .Builder ()
Original file line number Diff line number Diff line change 33 <string name =" api_host_local" translatable =" false" >10.0.2.2</string >
44 <string name =" api_host_dev" translatable =" false" >dev.api.fyreplace.app</string >
55 <string name =" api_host_main" translatable =" false" >api.fyreplace.app</string >
6- <string name =" api_host_default" translatable =" false" >@string/api_host_main</string >
7- <integer name =" api_port" >50051</integer >
6+ <integer name =" api_port_local" >50051</integer >
7+ <integer name =" api_port_dev" >443</integer >
8+ <integer name =" api_port_main" >443</integer >
89 <string name =" link_hosts" translatable =" false" >fyreplace.app;fyreplace.link</string >
910 <string name =" link_path_account_confirm_activation" >/AccountService.ConfirmActivation</string >
1011 <string name =" link_path_account_confirm_connection" >/AccountService.ConfirmConnection</string >
Load diff This file was deleted.
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments