publish: send read api call on loading note

This commit is contained in:
Matilde Park 2020-10-06 14:17:49 -04:00
parent 55c9fa5d25
commit e43bcb5f65
2 changed files with 12 additions and 1 deletions

View File

@ -187,8 +187,18 @@ export default class PublishApi extends BaseApi {
});
}
readNote(who: PatpNoSig, book: string, note: string) {
return this.publishAction({
read: {
who,
book,
note
}
});
}
updateComment(who: PatpNoSig, book: string, note: string, comment: Path, body: string) {
return this.publishAction({
return this.publishAction({
'edit-comment': {
who,
book,

View File

@ -33,6 +33,7 @@ export function Note(props: NoteProps & RouteComponentProps) {
const [deleting, setDeleting] = useState(false);
const { notebook, note, contacts, ship, book, noteId, api } = props;
useEffect(() => {
api.publish.readNote(ship.slice(1), book, noteId);
api.publish.fetchNote(ship, book, noteId);
}, [ship, book, noteId]);