mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-21 11:49:02 +08:00
fix: 改为远端优先实时镜像并避免自动同步反向覆盖
This commit is contained in:
+2
-2
@@ -189,7 +189,7 @@ function MainContent(): React.JSX.Element {
|
||||
if (conflicts.length > 0) {
|
||||
const recentLocalMutation = Date.now() - lastLocalMutationAtRef.current < 15000
|
||||
if (recentLocalMutation) {
|
||||
const autoApplyRes = await api.dbSyncApply("keep_local")
|
||||
const autoApplyRes = await api.dbSyncApply("keep_remote")
|
||||
if (
|
||||
autoApplyRes?.success &&
|
||||
autoApplyRes?.data?.success &&
|
||||
@@ -206,7 +206,7 @@ function MainContent(): React.JSX.Element {
|
||||
return
|
||||
}
|
||||
|
||||
const applyRes = await api.dbSyncApply("keep_local")
|
||||
const applyRes = await api.dbSyncApply("keep_remote")
|
||||
if (applyRes?.success && applyRes?.data?.success && applyRes?.data?.synced_records > 0) {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent("ss:data-updated", { detail: { category: "all", source: "sync" } })
|
||||
|
||||
Reference in New Issue
Block a user