Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import com.github.warnastrophy.core.permissions.AppPermissions
import com.github.warnastrophy.core.ui.common.ErrorHandler
import com.github.warnastrophy.core.ui.common.ErrorType
import com.github.warnastrophy.core.ui.navigation.Screen
import com.github.warnastrophy.core.util.AppConfig
import com.google.firebase.auth.FirebaseAuth
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -185,7 +187,8 @@ class DangerModeOrchestrator(
}
}

val contacts = contactsRepo?.getAllContacts()?.getOrNull()
val uid = FirebaseAuth.getInstance().uid ?: AppConfig.defaultUserId
val contacts = contactsRepo?.getAllContacts(uid)?.getOrNull()
if (!contacts.isNullOrEmpty()) {
emergencyPhoneNumber = contacts.first().phoneNumber
} else {
Expand Down Expand Up @@ -411,6 +414,7 @@ class DangerModeOrchestrator(
_state.value = OrchestratorState()
_showVoiceConfirmationScreen.value = false
_permissionRequests.value = null
movementService.setSafe()
}

/** Gets the current emergency phone number. This could be fetched from contacts in the future. */
Expand Down
Loading