We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7b45ac commit edadd3fCopy full SHA for edadd3f
1 file changed
src/persistence/local-db/index.ts
@@ -9,6 +9,10 @@ import { getLocalDbFilePath } from '../../utils';
9
const persistenceFile = getLocalDbFilePath();
10
11
export const saveNotesToFile = (noteMap: Map<string, CommentThread>) => {
12
+ // Avoid creating persistence file if no notes were created
13
+ if (!fs.existsSync(persistenceFile) && !noteMap.size) {
14
+ return;
15
+ }
16
fs.writeFileSync(persistenceFile, JSON.stringify(Serializer.serialize(noteMap)));
17
};
18
0 commit comments