Skip to content

Commit

Permalink
不同步系统配置
Browse files Browse the repository at this point in the history
  • Loading branch information
htmambo committed Feb 27, 2024
1 parent 13a436d commit c99de8d
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions app/utils/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,10 @@ const MergeStates: StateMerger = {
return localState;
},
[StoreKey.Mask]: (localState, remoteState) => {
const uniqueMasks = new Set();
const mergedMasks = [];
for (const mask of [...localState.masks, ...remoteState.masks]) {
let maskContent = mask.context[0].content;
if (!uniqueMasks.has(maskContent)) {
uniqueMasks.add(maskContent);
mergedMasks.push(mask);
}
}
localState.masks = mergedMasks;
localState.masks = {
...remoteState.masks,
...localState.masks,
};
return localState;
},
[StoreKey.Config]: mergeWithUpdate<AppState[StoreKey.Config]>,
Expand Down

0 comments on commit c99de8d

Please sign in to comment.