Merge pull request #3683 from urbit/mp/publish/fix-index-link

publish: fix 'notebook index' link
This commit is contained in:
matildepark 2020-10-08 16:58:40 -04:00 committed by GitHub
commit 8f77bde01c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,14 +31,12 @@ interface NoteProps {
export function Note(props: NoteProps & RouteComponentProps) {
const [deleting, setDeleting] = useState(false);
const { notebook, note, contacts, ship, book, noteId, api, baseUrl } = props;
const { notebook, note, contacts, ship, book, noteId, api, rootUrl } = props;
useEffect(() => {
api.publish.readNote(ship.slice(1), book, noteId);
api.publish.fetchNote(ship, book, noteId);
}, [ship, book, noteId]);
const rootUrl = props.baseUrl || '/~404';
const deletePost = async () => {
setDeleting(true);
await api.publish.delNote(ship.slice(1), book, noteId);