chore: firebase config, gitignore updates, build tweaks
This commit is contained in:
parent
af70280daa
commit
720b52a33b
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"projects": {
|
"projects": {
|
||||||
"default": "couples-connect-dev"
|
"default": "closer-real-app"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,3 +57,4 @@ UI-PLAN.md
|
||||||
# Build plans (agent-only, never commit)
|
# Build plans (agent-only, never commit)
|
||||||
*_build_plan.md
|
*_build_plan.md
|
||||||
closer_partner_proof_reveal_privacy.md
|
closer_partner_proof_reveal_privacy.md
|
||||||
|
app/google-services.json.bk
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ android {
|
||||||
compileSdk = 35
|
compileSdk = 35
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "app.closer"
|
applicationId = "closer.app.package"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 1
|
versionCode = 1
|
||||||
|
|
|
||||||
|
|
@ -41,14 +41,22 @@ class FirestoreInviteDataSource @Inject constructor(
|
||||||
?: throw IllegalStateException("Invalid response from createInviteCallable")
|
?: throw IllegalStateException("Invalid response from createInviteCallable")
|
||||||
val returnedCode = data["code"] as? String
|
val returnedCode = data["code"] as? String
|
||||||
?: throw IllegalStateException("Missing code in createInviteCallable response")
|
?: throw IllegalStateException("Missing code in createInviteCallable response")
|
||||||
val expiresAt = data["expiresAt"] as? com.google.firebase.Timestamp
|
// Callable SDK returns Timestamps as Map<_seconds, _nanoseconds>, not firebase.Timestamp.
|
||||||
?: throw IllegalStateException("Missing expiresAt in createInviteCallable response")
|
val expiresAt: com.google.firebase.Timestamp? = when (val raw = data["expiresAt"]) {
|
||||||
|
is com.google.firebase.Timestamp -> raw
|
||||||
|
is Map<*, *> -> {
|
||||||
|
val s = (raw["_seconds"] as? Long) ?: (raw["_seconds"] as? Int)?.toLong()
|
||||||
|
val n = (raw["_nanoseconds"] as? Long) ?: (raw["_nanoseconds"] as? Int)?.toLong()
|
||||||
|
if (s != null && n != null) com.google.firebase.Timestamp(s, n.toInt()) else null
|
||||||
|
}
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
return CreateInviteResponse(returnedCode, expiresAt)
|
return CreateInviteResponse(returnedCode, expiresAt)
|
||||||
}
|
}
|
||||||
|
|
||||||
data class CreateInviteResponse(
|
data class CreateInviteResponse(
|
||||||
val code: String,
|
val code: String,
|
||||||
val expiresAt: com.google.firebase.Timestamp
|
val expiresAt: com.google.firebase.Timestamp? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package app.closer.ui.pairing
|
package app.closer.ui.pairing
|
||||||
|
|
||||||
|
import android.util.Log
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import app.closer.core.navigation.AppRoute
|
import app.closer.core.navigation.AppRoute
|
||||||
|
|
@ -48,6 +49,7 @@ class CreateInviteViewModel @Inject constructor(
|
||||||
_uiState.update { it.copy(isLoading = false, inviteCode = result.code, recoveryPhrase = result.recoveryPhrase) }
|
_uiState.update { it.copy(isLoading = false, inviteCode = result.code, recoveryPhrase = result.recoveryPhrase) }
|
||||||
}
|
}
|
||||||
.onFailure { e ->
|
.onFailure { e ->
|
||||||
|
Log.e(TAG, "createInvite failed", e)
|
||||||
_uiState.update { it.copy(isLoading = false, error = e.message ?: "Couldn't create invite. Please try again.") }
|
_uiState.update { it.copy(isLoading = false, error = e.message ?: "Couldn't create invite. Please try again.") }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -55,4 +57,8 @@ class CreateInviteViewModel @Inject constructor(
|
||||||
|
|
||||||
fun onNavigated() = _uiState.update { it.copy(navigateTo = null) }
|
fun onNavigated() = _uiState.update { it.copy(navigateTo = null) }
|
||||||
fun dismissError() = _uiState.update { it.copy(error = null) }
|
fun dismissError() = _uiState.update { it.copy(error = null) }
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "CreateInviteViewModel"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,22 @@
|
||||||
{
|
{
|
||||||
"indexes": [],
|
"indexes": [
|
||||||
|
{
|
||||||
|
"collectionGroup": "invites",
|
||||||
|
"queryScope": "COLLECTION",
|
||||||
|
"fields": [
|
||||||
|
{ "fieldPath": "inviterUserId", "order": "ASCENDING" },
|
||||||
|
{ "fieldPath": "createdAt", "order": "DESCENDING" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"collectionGroup": "capsules",
|
||||||
|
"queryScope": "COLLECTION_GROUP",
|
||||||
|
"fields": [
|
||||||
|
{ "fieldPath": "status", "order": "ASCENDING" },
|
||||||
|
{ "fieldPath": "unlockAt", "order": "ASCENDING" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"fieldOverrides": [
|
"fieldOverrides": [
|
||||||
{
|
{
|
||||||
"collectionGroup": "invite_attempts",
|
"collectionGroup": "invite_attempts",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue