chore: remove dead invite code after Cloud Function migration (batch v0.2.19)

- Remove unused markAccepted from InviteRepository/Impl
- Remove unused loadedInvite field from InviteConfirmViewModel
- Fix deprecated getHttpsCallable result access
- Remove unused SetOptions import
This commit is contained in:
null 2026-06-19 21:50:29 -05:00
parent 39255c8733
commit c31177d52b
6 changed files with 5 additions and 12 deletions

View File

@ -3,7 +3,6 @@ package app.closer.data.remote
import app.closer.crypto.RecoveryKeyManager import app.closer.crypto.RecoveryKeyManager
import app.closer.domain.model.Invite import app.closer.domain.model.Invite
import com.google.firebase.firestore.FirebaseFirestore import com.google.firebase.firestore.FirebaseFirestore
import com.google.firebase.firestore.SetOptions
import com.google.firebase.Timestamp import com.google.firebase.Timestamp
import com.google.firebase.functions.FirebaseFunctions import com.google.firebase.functions.FirebaseFunctions
import kotlinx.coroutines.suspendCancellableCoroutine import kotlinx.coroutines.suspendCancellableCoroutine
@ -85,10 +84,11 @@ class FirestoreInviteDataSource @Inject constructor(
* can decrypt the couple keyset locally. * can decrypt the couple keyset locally.
*/ */
suspend fun acceptInvite(code: String, recoveryPhrase: String): app.closer.domain.repository.AcceptInviteResult { suspend fun acceptInvite(code: String, recoveryPhrase: String): app.closer.domain.repository.AcceptInviteResult {
@Suppress("DEPRECATION")
val result = functions.getHttpsCallable("acceptInviteCallable") val result = functions.getHttpsCallable("acceptInviteCallable")
.call(mapOf("code" to code, "recoveryPhrase" to recoveryPhrase)) .call(mapOf("code" to code, "recoveryPhrase" to recoveryPhrase))
.await() .await()
val data = result.data as? Map<*, *> val data = result.getData() as? Map<*, *>
?: throw IllegalStateException("Invalid response from acceptInviteCallable") ?: throw IllegalStateException("Invalid response from acceptInviteCallable")
val coupleId = data["coupleId"] as? String val coupleId = data["coupleId"] as? String

View File

@ -26,10 +26,6 @@ class InviteRepositoryImpl @Inject constructor(
dataSource.getInviteByCode(code) dataSource.getInviteByCode(code)
} }
override suspend fun markAccepted(code: String, acceptorUserId: String, coupleId: String): Result<Unit> = runCatching {
dataSource.markAccepted(code, acceptorUserId, coupleId)
}
override suspend fun acceptInvite(code: String, acceptorUserId: String, recoveryPhrase: String): Result<AcceptInviteResult> = runCatching { override suspend fun acceptInvite(code: String, acceptorUserId: String, recoveryPhrase: String): Result<AcceptInviteResult> = runCatching {
dataSource.acceptInvite(code, recoveryPhrase) dataSource.acceptInvite(code, recoveryPhrase)
} }

View File

@ -20,6 +20,5 @@ data class AcceptInviteResult(
interface InviteRepository { interface InviteRepository {
suspend fun createInvite(inviterUserId: String): Result<CreateInviteResult> suspend fun createInvite(inviterUserId: String): Result<CreateInviteResult>
suspend fun getInviteByCode(code: String): Result<Invite?> suspend fun getInviteByCode(code: String): Result<Invite?>
suspend fun markAccepted(code: String, acceptorUserId: String, coupleId: String): Result<Unit>
suspend fun acceptInvite(code: String, acceptorUserId: String, recoveryPhrase: String): Result<AcceptInviteResult> suspend fun acceptInvite(code: String, acceptorUserId: String, recoveryPhrase: String): Result<AcceptInviteResult>
} }

View File

@ -6,7 +6,6 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import app.closer.core.navigation.AppRoute import app.closer.core.navigation.AppRoute
import app.closer.crypto.CoupleEncryptionManager import app.closer.crypto.CoupleEncryptionManager
import app.closer.domain.model.Invite
import app.closer.domain.repository.AuthRepository import app.closer.domain.repository.AuthRepository
import app.closer.domain.repository.InviteRepository import app.closer.domain.repository.InviteRepository
import app.closer.domain.repository.UserRepository import app.closer.domain.repository.UserRepository
@ -38,8 +37,6 @@ class InviteConfirmViewModel @Inject constructor(
) : ViewModel() { ) : ViewModel() {
private val inviteCode: String = savedStateHandle["inviteCode"] ?: "" private val inviteCode: String = savedStateHandle["inviteCode"] ?: ""
// No longer loaded client-side; the Cloud Function returns it server-side.
private var loadedInvite: Invite? = null
private val _uiState = MutableStateFlow(InviteConfirmUiState()) private val _uiState = MutableStateFlow(InviteConfirmUiState())
val uiState: StateFlow<InviteConfirmUiState> = _uiState.asStateFlow() val uiState: StateFlow<InviteConfirmUiState> = _uiState.asStateFlow()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 85 KiB

View File

@ -26,8 +26,9 @@
</g> </g>
<text x="408" y="142" fill="#FFF8FC" font-family="DejaVu Sans" font-size="72" font-weight="700">Closer</text> <text x="408" y="142" fill="#FFF8FC" font-family="DejaVu Sans" font-size="72" font-weight="700">Closer</text>
<text x="412" y="198" fill="#F7C8E4" font-family="DejaVu Sans" font-size="26" font-weight="600">A private space for two.</text> <text x="412" y="198" fill="#F7C8E4" font-family="DejaVu Sans" font-size="26" font-weight="600">A private space</text>
<text x="412" y="236" fill="#F3E8FF" font-family="DejaVu Sans" font-size="18" font-weight="500">Private questions, reveals, and rituals for couples.</text> <text x="660" y="198" fill="#FFF8FC" font-family="DejaVu Sans" font-size="26" font-weight="700">for two.</text>
<text x="412" y="236" fill="#F3E8FF" font-family="DejaVu Sans" font-size="18" font-weight="500">Private questions and intentional reveals.</text>
<g transform="translate(408 274)" filter="url(#cardShadow)"> <g transform="translate(408 274)" filter="url(#cardShadow)">
<rect width="176" height="116" rx="22" fill="#FFF8FC"/> <rect width="176" height="116" rx="22" fill="#FFF8FC"/>

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB