fixed duplicate note in newsfeed and minor fixes
This commit is contained in:
@@ -1,7 +1,15 @@
|
||||
import { atom } from 'jotai';
|
||||
import { atomWithReset } from 'jotai/utils';
|
||||
|
||||
// notes
|
||||
export const notesAtom = atom([]);
|
||||
export const filteredNotesAtom = atom((get) => {
|
||||
const notes = get(notesAtom);
|
||||
return notes.filter((item, index) => index === notes.findIndex((other) => item.parent_id === other.parent_id));
|
||||
});
|
||||
|
||||
// note content
|
||||
export const noteContentAtom = atomWithReset('');
|
||||
|
||||
// notify user that connector has receive newer note
|
||||
export const hasNewerNoteAtom = atom(false);
|
||||
|
||||
Reference in New Issue
Block a user