Commit e52bde55 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'fix/updateData' into 'main'

修复updateData错误更新本地数据BUG

See merge request mycard/Neos!311
parents 8e006333 3cf648e9
Pipeline #23448 passed with stages
in 14 minutes and 40 seconds
...@@ -15,13 +15,10 @@ export default async (updateData: MsgUpdateData) => { ...@@ -15,13 +15,10 @@ export default async (updateData: MsgUpdateData) => {
.filter((card) => card.location.sequence === sequence) .filter((card) => card.location.sequence === sequence)
.at(0); .at(0);
if (target) { if (target) {
// 目前只更新以下字段 if (action?.code > 0 && target.code === 0) {
if (action?.code >= 0) { // 当本地code为0且action的code大于0时,才从db加载整个meta信息
const newMeta = fetchCard(action.code); const newMeta = fetchCard(action.code);
if (target.code !== action.code) {
// 这个if判断一定要有,不然会触发`genCard`里面的事件
target.code = action.code; target.code = action.code;
}
target.meta = newMeta; target.meta = newMeta;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment