mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-12 00:28:20 -04:00
fix(crashlytics): resolve beta 2.7.14 crash issues (#5245)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -110,8 +110,9 @@ class PacketRepositoryImpl(private val dbManager: DatabaseProvider, private val
|
||||
dao.upsertContactSettings(listOf(updated))
|
||||
}
|
||||
|
||||
override suspend fun getQueuedPackets(): List<DataPacket> =
|
||||
withContext(dispatchers.io) { dbManager.currentDb.value.packetDao().getQueuedPackets() }
|
||||
override suspend fun getQueuedPackets(): List<DataPacket> = withContext(dispatchers.io) {
|
||||
dbManager.currentDb.value.packetDao().getAllDataPackets().filter { it.status == MessageStatus.QUEUED }
|
||||
}
|
||||
|
||||
suspend fun insertRoomPacket(packet: RoomPacket) =
|
||||
withContext(dispatchers.io) { dbManager.currentDb.value.packetDao().insert(packet) }
|
||||
|
||||
@@ -338,15 +338,16 @@ interface PacketDao {
|
||||
)
|
||||
suspend fun findPacketBySfppHash(hash: ByteString): Packet?
|
||||
|
||||
// Fetches all DataPackets for the current node, ordered by time.
|
||||
// Callers should filter by status in Kotlin (avoids SQLite json_extract dependency).
|
||||
@Query(
|
||||
"""
|
||||
SELECT data FROM packet
|
||||
WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM my_node))
|
||||
AND json_extract(data, '${"$"}.status') = 'QUEUED'
|
||||
ORDER BY received_time ASC
|
||||
""",
|
||||
)
|
||||
suspend fun getQueuedPackets(): List<DataPacket>
|
||||
suspend fun getAllDataPackets(): List<DataPacket>
|
||||
|
||||
@Query(
|
||||
"""
|
||||
|
||||
@@ -164,7 +164,7 @@ abstract class CommonPacketDaoTest {
|
||||
),
|
||||
)
|
||||
packetDao.insert(queuedPacket)
|
||||
val queued = packetDao.getQueuedPackets()
|
||||
val queued = packetDao.getAllDataPackets().filter { it.status == MessageStatus.QUEUED }
|
||||
assertNotNull(queued)
|
||||
assertEquals(1, queued.size)
|
||||
assertEquals("Queued", queued.first().text)
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.meshtastic.feature.widget
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.collectAsState
|
||||
@@ -36,13 +37,13 @@ import androidx.glance.Image
|
||||
import androidx.glance.ImageProvider
|
||||
import androidx.glance.LocalContext
|
||||
import androidx.glance.LocalSize
|
||||
import androidx.glance.action.actionStartActivity
|
||||
import androidx.glance.action.clickable
|
||||
import androidx.glance.appwidget.CircularProgressIndicator
|
||||
import androidx.glance.appwidget.GlanceAppWidget
|
||||
import androidx.glance.appwidget.LinearProgressIndicator
|
||||
import androidx.glance.appwidget.SizeMode
|
||||
import androidx.glance.appwidget.action.actionRunCallback
|
||||
import androidx.glance.appwidget.action.actionStartActivity
|
||||
import androidx.glance.appwidget.components.CircleIconButton
|
||||
import androidx.glance.appwidget.components.Scaffold
|
||||
import androidx.glance.appwidget.components.TitleBar
|
||||
@@ -148,10 +149,8 @@ class LocalStatsWidget :
|
||||
GlanceModifier.fillMaxSize()
|
||||
.clickable(
|
||||
actionStartActivity(
|
||||
android.content.ComponentName(
|
||||
context.packageName,
|
||||
"org.meshtastic.app.MainActivity",
|
||||
),
|
||||
context.packageManager.getLaunchIntentForPackage(context.packageName)
|
||||
?: Intent().setClassName(context.packageName, "org.meshtastic.app.MainActivity"),
|
||||
),
|
||||
),
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user