feat: migrate to navigation3 #7
@@ -30,9 +30,10 @@ class NostrForegroundService : Service() {
|
||||
return ProcessLifecycleOwner.get().lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
createNotificationChannel()
|
||||
}
|
||||
|
||||
val notification = createNotification()
|
||||
startForeground(1, notification)
|
||||
@@ -78,7 +79,7 @@ class NostrForegroundService : Service() {
|
||||
val manager = getSystemService(NotificationManager::class.java)
|
||||
|
||||
val serviceChannel = NotificationChannel(
|
||||
"nostr_service_silent",
|
||||
"nostr_service",
|
||||
"Nostr Background Status",
|
||||
NotificationManager.IMPORTANCE_MIN
|
||||
).apply {
|
||||
|
||||
@@ -202,6 +202,7 @@ class NostrViewModel(
|
||||
|
||||
private fun login() {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val secret = secretStore.get("user_signer")
|
||||
|
||||
if (secret == null) {
|
||||
@@ -218,6 +219,10 @@ class NostrViewModel(
|
||||
showError("Login failed: ${e.message}")
|
||||
_signerRequired.value = true
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
showError("Login failed: ${e.message}")
|
||||
_signerRequired.value = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user