Open Mara-Li opened 1 year ago
Could you elaborate on this a little more? I am not sure if I can reproduce this locally because for me, moved, renamed, or deleted files/folders are updated accordingly in the json data.
I recorded a video with deleting a file for example of my issue:
Hmm. I am not able to reproduce this. Would it be possible to debug this yourself locally? Normally, this function should be called.
Not related, but got this in the logs when loading/reloading the plugin:
Fixed by using ?
:
export const getExtraPath = (iconPackName: string): string | undefined => {
const path = Object.values(iconPacks).find((iconPack) => iconPack.name === iconPackName)?.path;
return path?.length === 0 ? undefined : path;
};
Also get this when deleting:
And this on creating:
For the deleting/renaming, it's pretty strange. I can repro on some file and not others :/. Maybe adding a clean-up during Plugin load can help ? As file can be removed outside Obsidian it can help a lot.
Also, get that:
util.ts:99 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'substring')
at removeIconFromIconPack (util.ts:99:37)
at IconFolderPlugin.removeFolderIcon (main.ts:451:7)
at IconFolderPlugin.eval (main.ts:110:12)
at Generator.next (<anonymous>)
at fulfilled (tslib.es6.js:118:58)
Okay found!
The last one appear for inheritance where iconName is null.
I will make a PR with my change/proposition :)
See #262 for more information & cleanUp function
Is your feature request related to a problem? Please describe. The data.json become more and more big when in a big vault, as file are moved, renamed. The settings doesn't autoclean so it can lead to surprising icon/error when recreating file.
Describe the solution you'd like A listener to renamed/deleted/moved file, to remove old path.
Describe alternatives you've considered A node script that autoclean the data.
Additional context My js script: (feat french & english :'D)