client: password modal fixes for protected posts

This commit is contained in:
Max Leiter 2022-04-01 16:51:23 -07:00
parent ead3b0af9d
commit f20fa72b6d
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA
4 changed files with 4 additions and 3 deletions

View file

@ -229,7 +229,7 @@ const Post = () => {
</ButtonDropdown> </ButtonDropdown>
</div> </div>
</div> </div>
<PasswordModal isOpen={passwordModalVisible} onClose={onClosePasswordModal} onSubmit={submitPassword} /> <PasswordModal creating={true} isOpen={passwordModalVisible} onClose={onClosePasswordModal} onSubmit={submitPassword} />
</div> </div>
) )
} }

View file

@ -3,7 +3,7 @@ import { Modal, Note, Spacer, Input } from "@geist-ui/core"
import { useState } from "react" import { useState } from "react"
type Props = { type Props = {
creating?: boolean creating: boolean
isOpen: boolean isOpen: boolean
onClose: () => void onClose: () => void
onSubmit: (password: string) => void onSubmit: (password: string) => void

View file

@ -63,6 +63,7 @@ const Post = () => {
const onClose = () => { const onClose = () => {
setIsPasswordModalOpen(false); setIsPasswordModalOpen(false);
router.push("/");
} }
if (!router.isReady) { if (!router.isReady) {