From f20fa72b6dc95f34b78de168f72dd4a1052b5e5b Mon Sep 17 00:00:00 2001 From: Max Leiter Date: Fri, 1 Apr 2022 16:51:23 -0700 Subject: [PATCH] client: password modal fixes for protected posts --- client/components/new-post/index.tsx | 2 +- client/components/new-post/password-modal/index.tsx | 2 +- client/pages/post/protected/[id].tsx | 1 + server/src/database.ts | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/components/new-post/index.tsx b/client/components/new-post/index.tsx index a26b727b..fa3f3dc3 100644 --- a/client/components/new-post/index.tsx +++ b/client/components/new-post/index.tsx @@ -229,7 +229,7 @@ const Post = () => { - + ) } diff --git a/client/components/new-post/password-modal/index.tsx b/client/components/new-post/password-modal/index.tsx index 040f6af8..c80ea41b 100644 --- a/client/components/new-post/password-modal/index.tsx +++ b/client/components/new-post/password-modal/index.tsx @@ -3,7 +3,7 @@ import { Modal, Note, Spacer, Input } from "@geist-ui/core" import { useState } from "react" type Props = { - creating?: boolean + creating: boolean isOpen: boolean onClose: () => void onSubmit: (password: string) => void diff --git a/client/pages/post/protected/[id].tsx b/client/pages/post/protected/[id].tsx index 5dcbdc27..a0c6a085 100644 --- a/client/pages/post/protected/[id].tsx +++ b/client/pages/post/protected/[id].tsx @@ -63,6 +63,7 @@ const Post = () => { const onClose = () => { setIsPasswordModalOpen(false); + router.push("/"); } if (!router.isReady) { diff --git a/server/src/database.ts b/server/src/database.ts index e9f2b69f..deae23a2 100644 --- a/server/src/database.ts +++ b/server/src/database.ts @@ -32,7 +32,7 @@ export type Migration = typeof umzug._types.migration // If you're in a development environment, you can manually migrate with `yarn migrate:{up,down}` in the `server` folder if (config.is_production) { - ; (async () => { + ;(async () => { // Checks migrations and run them if they are not already applied. To keep // track of the executed migrations, a table (and sequelize model) called SequelizeMeta // will be automatically created (if it doesn't exist already) and parsed.