Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix show files description

sytolk98625c3c9b30
diff --git a/app/services/utils-io.ts b/app/services/utils-io.ts
index 5f3461ad3..570ec7eb6 100644
--- a/app/services/utils-io.ts
+++ b/app/services/utils-io.ts
@@ -1220,17 +1220,18 @@ export function fileNameValidation(fileName): boolean {
/**
* https://stackoverflow.com/a/71981197/2285631
- * TODO this not merge with "b" properties that missing in "a"
* @param a
* @param b
*/
-export const merge = (a, b) =>
- Object.fromEntries(
- Object.entries(a).map(([k, v]) => [
+export const merge = (a, b) => {
+ const allKeys = { ...b, ...a };
+ return Object.fromEntries(
+ Object.entries(allKeys).map(([k, v]) => [
k,
v && Array.isArray(v) ? mergeTags(v, b[k]) : v || b[k]
])
);
+};
function mergeTags(oldTagsArray: Array<TS.Tag>, newTagsArray: Array<TS.Tag>) {
if (newTagsArray.length === 0) {