1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Desktop: Add support for custom notebook icons (#6110)

This commit is contained in:
Laurent
2022-02-06 16:42:00 +00:00
committed by GitHub
parent db497ee0a5
commit 9f252ea673
13 changed files with 151 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
import { FolderEntity, FolderIcon, NoteEntity } from '../services/database/types';
import { defaultFolderIcon, FolderEntity, FolderIcon, NoteEntity } from '../services/database/types';
import BaseModel, { DeleteOptions } from '../BaseModel';
import time from '../time';
import { _ } from '../locale';
@@ -767,7 +767,11 @@ export default class Folder extends BaseItem {
}
public static unserializeIcon(icon: string): FolderIcon {
return icon ? JSON.parse(icon) : null;
if (!icon) return null;
return {
...defaultFolderIcon(),
...JSON.parse(icon),
};
}
}