Update def.ts
This commit is contained in:
parent
ca3710bc1f
commit
f5bd895e18
|
@ -398,9 +398,20 @@ export const PREF_DEF = {
|
||||||
accountDependent: true,
|
accountDependent: true,
|
||||||
default: [] as WatermarkPreset[],
|
default: [] as WatermarkPreset[],
|
||||||
mergeStrategy: (a, b) => {
|
mergeStrategy: (a, b) => {
|
||||||
const sameIdExists = a.some(x => b.some(y => x.id === y.id));
|
const mergedItems = [] as (typeof a)[];
|
||||||
if (sameIdExists) throw new Error();
|
for (const x of a.concat(b)) {
|
||||||
return a.concat(b);
|
const sameIdItem = mergedItems.find(y => y.id === x.id);
|
||||||
|
if (sameIdItem != null) {
|
||||||
|
if (deepEqual(x, sameIdItem)) { // 完全な重複は無視
|
||||||
|
continue;
|
||||||
|
} else { // IDは同じなのに内容が違う場合はマージ不可とする
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mergedItems.push(x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mergedItems;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
defaultWatermarkPresetId: {
|
defaultWatermarkPresetId: {
|
||||||
|
|
Loading…
Reference in New Issue