增加冲突自动合并提醒
This commit is contained in:
parent
480875a5ec
commit
867315a19d
@ -186,6 +186,8 @@ function mergeContent(serverContent, clientContent, lastMergedContent = {}) {
|
||||
clientContent.comments,
|
||||
lastMergedContent.comments,
|
||||
),
|
||||
// 服务端和本地都变更了
|
||||
mergeFlag: isServerTextChanges && isClientTextChanges,
|
||||
};
|
||||
restoreDiscussionOffsets(result, markerKeys);
|
||||
return result;
|
||||
|
@ -424,6 +424,10 @@ const syncFile = async (fileId, syncContext = new SyncContext()) => {
|
||||
lastMergedContent = syncedContent.historyData[syncHistoryItem[LAST_MERGED]];
|
||||
}
|
||||
mergedContent = diffUtils.mergeContent(serverContent, clientContent, lastMergedContent);
|
||||
if (mergedContent.mergeFlag) {
|
||||
const file = store.state.file.itemsById[syncLocation.fileId];
|
||||
store.dispatch('notification/info', `${file.name} 存在冲突已自动合并,请注意合并结果!`);
|
||||
}
|
||||
}
|
||||
if (!mergedContent) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user