feat: 实现原生通知持久化与解析,支持 SQLite 存储和规则引擎
This commit is contained in:
@@ -111,15 +111,30 @@ export const useTransactionEntry = () => {
|
||||
continue
|
||||
}
|
||||
|
||||
if (!requiresConfirmation) {
|
||||
await transactionStore.addTransaction(transaction)
|
||||
await acknowledgeNotification(item.id)
|
||||
if (nativeBridgeReady) {
|
||||
// 原生环境:规则在 Kotlin 原生层已经执行并写入 SQLite,这里只负责「待确认」列表和状态同步
|
||||
if (!requiresConfirmation) {
|
||||
// 已由原生自动入账,只需从原生通知队列中移除该条
|
||||
await acknowledgeNotification(item.id)
|
||||
} else {
|
||||
manualQueue.push({
|
||||
...item,
|
||||
suggestion: transaction,
|
||||
ruleId: rule?.id || null,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
manualQueue.push({
|
||||
...item,
|
||||
suggestion: transaction,
|
||||
ruleId: rule?.id || null,
|
||||
})
|
||||
// Web / 模拟环境:沿用原有逻辑,由 JS 侧写入 SQLite
|
||||
if (!requiresConfirmation) {
|
||||
await transactionStore.addTransaction(transaction)
|
||||
await acknowledgeNotification(item.id)
|
||||
} else {
|
||||
manualQueue.push({
|
||||
...item,
|
||||
suggestion: transaction,
|
||||
ruleId: rule?.id || null,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
notifications.value = manualQueue
|
||||
|
||||
Reference in New Issue
Block a user