mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
publish: send read api call on loading note
This commit is contained in:
parent
55c9fa5d25
commit
e43bcb5f65
@ -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,
|
||||
|
@ -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]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user