Skip to content

Commit

Permalink
Go to login screen in case of an error during splash screen calls
Browse files Browse the repository at this point in the history
Fix deploy issues
  • Loading branch information
flaviuvsp committed Feb 5, 2024
1 parent d5ba6c5 commit 2c6d5fc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deployRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release to Play store
on:
workflow_dispatch:
push:
branches: [ "release-disabled/**" ]
branches: [ "bugfix/VSP-1340-Fix-login-issue" ]

jobs:
build:
Expand Down Expand Up @@ -52,12 +52,13 @@ jobs:
KEYSTORE_FILE: '${{ github.workspace }}/permanent.keystore'
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }}
MIXPANEL_KEY: ${{ secrets.MIXPANEL_KEY }}
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
run: |
touch local.properties
echo GMP_KEY="$GMP_KEY" >> local.properties
echo AUTH_CLIENT_ID="$AUTH_CLIENT_ID" >> local.properties
echo AUTH_CLIENT_SECRET="$AUTH_CLIENT_SECRET" >> local.properties
echo PUBLISHABLE_KEY="$PUBLISHABLE_KEY" >> local.properties
echo MIXPANEL_TOKEN="$MIXPANEL_TOKEN" >> local.properties
bundle exec fastlane playStore
shell: bash
5 changes: 3 additions & 2 deletions .github/workflows/deployStaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to Staging
on:
workflow_dispatch:
push:
branches: [ "master-disabled" ]
branches: [ "master" ]

jobs:
build:
Expand Down Expand Up @@ -44,12 +44,13 @@ jobs:
PUBLISHABLE_KEY: ${{ secrets.PUBLISHABLE_KEY }}
APP_ID: ${{ secrets.APP_ID }}
FIREBASEAPPDISTRO_CLI_TOKEN: ${{ secrets.FIREBASEAPPDISTRO_CLI_TOKEN }}
MIXPANEL_KEY: ${{ secrets.MIXPANEL_KEY }}
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
run: |
touch local.properties
echo GMP_KEY="$GMP_KEY" >> local.properties
echo AUTH_CLIENT_ID="$AUTH_CLIENT_ID" >> local.properties
echo AUTH_CLIENT_SECRET="$AUTH_CLIENT_SECRET" >> local.properties
echo PUBLISHABLE_KEY="$PUBLISHABLE_KEY" >> local.properties
echo MIXPANEL_TOKEN="$MIXPANEL_TOKEN" >> local.properties
bundle exec fastlane firebase
shell: bash
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ android {
applicationId "org.permanent.PermanentArchive"
minSdkVersion 26
targetSdkVersion 34
versionCode 56
versionName "1.8.2"
versionCode 62
versionName "1.8.6"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/permanent/permanent/EventsManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.mixpanel.android.mpmetrics.MixpanelAPI
import org.json.JSONObject

class EventsManager(context: Context) {
private val mp: MixpanelAPI = MixpanelAPI.getInstance(context, BuildConfig.MIXPANEL_KEY, true)
private val mp: MixpanelAPI = MixpanelAPI.getInstance(context, BuildConfig.MIXPANEL_TOKEN, true)

fun sendToMixpanel(event: EventType, properties: JSONObject? = null) {
mp.track(event.value, properties)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.core.content.ContextCompat
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.Observer
Expand All @@ -32,11 +33,17 @@ class SplashActivity : PermanentBaseActivity() {
private lateinit var viewModel: SplashViewModel

private val errorObserver = Observer<String> {
val snackBar = Snackbar.make(binding.root, it, Snackbar.LENGTH_LONG)
val view: View = snackBar.view
view.setBackgroundColor(ContextCompat.getColor(this, R.color.deepRed))
snackBar.setTextColor(ContextCompat.getColor(this, R.color.white))
snackBar.show()
prefsHelper.saveUserLoggedIn(false)
prefsHelper.saveDefaultArchiveId(0)
prefsHelper.saveBiometricsLogIn(true) // Setting back to default

startLoginActivity()

Toast.makeText(
this,
it,
Toast.LENGTH_SHORT
).show()
}

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down

0 comments on commit 2c6d5fc

Please sign in to comment.