mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
Clear cached data after publishing.
This commit is contained in:
@@ -8,6 +8,7 @@ import showToast from "../components/toast.ts";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { app } from "../app.ts";
|
||||
import { ErrorAlert } from "../components/alert.tsx";
|
||||
import {useAppContext} from "../components/AppContext.tsx";
|
||||
|
||||
export default function PublishPage() {
|
||||
const [title, setTitle] = useState<string>("")
|
||||
@@ -22,6 +23,8 @@ export default function PublishPage() {
|
||||
const navigate = useNavigate()
|
||||
const { t } = useTranslation();
|
||||
|
||||
const appContext = useAppContext()
|
||||
|
||||
useEffect(() => {
|
||||
document.title = t("Publish Resource");
|
||||
}, [t])
|
||||
@@ -57,6 +60,7 @@ export default function PublishPage() {
|
||||
})
|
||||
if (res.success) {
|
||||
setSubmitting(false)
|
||||
appContext.clear();
|
||||
navigate("/resources/" + res.data!, { replace: true })
|
||||
} else {
|
||||
setSubmitting(false)
|
||||
|
Reference in New Issue
Block a user