Skip to content

Commit bb1b9a4

Browse files
committed
show message for unavailable feature.
1 parent 512cb9d commit bb1b9a4

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

base/src/fdroid/java/com/windscribe/vpn/services/sso/GoogleSignInManagerImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import android.content.Intent
66
class GoogleSignInManagerImpl(val context: Context) : GoogleSignInManager() {
77
override fun getSignInIntent() = null
88
override fun getToken(result: Intent, callback: (String?, String?) -> Unit) {
9-
callback(null,"Google sign in not supported on F-Droid")
9+
callback(null,"Google sign in not available in F-Droid version")
1010
}
1111
override fun signOut(callback: () -> Unit) {
1212
callback()

mobile/src/main/java/com/windscribe/mobile/ui/auth/AppStartScreen.kt

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,16 @@ private fun GoogleButton(viewModel: AppStartViewModel?) {
229229
val activity = LocalContext.current as? AppStartActivity
230230
Button(
231231
onClick = {
232-
if (signInIntent == null){
233-
Toast.makeText(activity, "Google Signin not available.", Toast.LENGTH_SHORT).show()
234-
return@Button
232+
if (com.windscribe.mobile.BuildConfig.FLAVOR == "google") {
233+
if (signInIntent == null){
234+
Toast.makeText(activity, "Google Signin not available.", Toast.LENGTH_SHORT).show()
235+
return@Button
236+
}
237+
viewModel.onSignIntentLaunch()
238+
launcher.launch(signInIntent)
239+
} else {
240+
Toast.makeText(activity, "Google Sign-in not available in F-Droid version", Toast.LENGTH_SHORT).show()
235241
}
236-
viewModel.onSignIntentLaunch()
237-
launcher.launch(signInIntent)
238242
},
239243
Modifier
240244
.height(48.dp)
@@ -298,12 +302,17 @@ private fun LoginButton() {
298302
@Composable
299303
fun EmergencyConnectButton(isConnected: Boolean) {
300304
val navController = LocalNavController.current
305+
val context = LocalContext.current
301306
Text(
302307
text = if (isConnected) "Emergency Connect On" else "Can’t Connect?",
303308
style = font18.copy(fontWeight = FontWeight.Medium),
304309
color = if (isConnected) Color(0xFF61FF8A) else Color(0xFF838D9B),
305310
modifier = Modifier.clickable {
306-
navController.navigate(Screen.EmergencyConnect.route)
311+
if (com.windscribe.mobile.BuildConfig.FLAVOR == "google") {
312+
navController.navigate(Screen.EmergencyConnect.route)
313+
} else {
314+
Toast.makeText(context, "Emergency Connect not available in F-Droid version", Toast.LENGTH_SHORT).show()
315+
}
307316
}
308317
)
309318
}

0 commit comments

Comments
 (0)