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:
parent
39255c8733
commit
c31177d52b
|
|
@ -3,7 +3,6 @@ package app.closer.data.remote
|
|||
import app.closer.crypto.RecoveryKeyManager
|
||||
import app.closer.domain.model.Invite
|
||||
import com.google.firebase.firestore.FirebaseFirestore
|
||||
import com.google.firebase.firestore.SetOptions
|
||||
import com.google.firebase.Timestamp
|
||||
import com.google.firebase.functions.FirebaseFunctions
|
||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||
|
|
@ -85,10 +84,11 @@ class FirestoreInviteDataSource @Inject constructor(
|
|||
* can decrypt the couple keyset locally.
|
||||
*/
|
||||
suspend fun acceptInvite(code: String, recoveryPhrase: String): app.closer.domain.repository.AcceptInviteResult {
|
||||
@Suppress("DEPRECATION")
|
||||
val result = functions.getHttpsCallable("acceptInviteCallable")
|
||||
.call(mapOf("code" to code, "recoveryPhrase" to recoveryPhrase))
|
||||
.await()
|
||||
val data = result.data as? Map<*, *>
|
||||
val data = result.getData() as? Map<*, *>
|
||||
?: throw IllegalStateException("Invalid response from acceptInviteCallable")
|
||||
|
||||
val coupleId = data["coupleId"] as? String
|
||||
|
|
|
|||
|
|
@ -26,10 +26,6 @@ class InviteRepositoryImpl @Inject constructor(
|
|||
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 {
|
||||
dataSource.acceptInvite(code, recoveryPhrase)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,5 @@ data class AcceptInviteResult(
|
|||
interface InviteRepository {
|
||||
suspend fun createInvite(inviterUserId: String): Result<CreateInviteResult>
|
||||
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>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import androidx.lifecycle.ViewModel
|
|||
import androidx.lifecycle.viewModelScope
|
||||
import app.closer.core.navigation.AppRoute
|
||||
import app.closer.crypto.CoupleEncryptionManager
|
||||
import app.closer.domain.model.Invite
|
||||
import app.closer.domain.repository.AuthRepository
|
||||
import app.closer.domain.repository.InviteRepository
|
||||
import app.closer.domain.repository.UserRepository
|
||||
|
|
@ -38,8 +37,6 @@ class InviteConfirmViewModel @Inject constructor(
|
|||
) : ViewModel() {
|
||||
|
||||
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())
|
||||
val uiState: StateFlow<InviteConfirmUiState> = _uiState.asStateFlow()
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 85 KiB |
|
|
@ -26,8 +26,9 @@
|
|||
</g>
|
||||
|
||||
<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="236" fill="#F3E8FF" font-family="DejaVu Sans" font-size="18" font-weight="500">Private questions, reveals, and rituals for couples.</text>
|
||||
<text x="412" y="198" fill="#F7C8E4" font-family="DejaVu Sans" font-size="26" font-weight="600">A private space</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)">
|
||||
<rect width="176" height="116" rx="22" fill="#FFF8FC"/>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.9 KiB |
Loading…
Reference in New Issue