mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-02 16:20:36 -05:00
Fix "get perms" alert not shown if no video adder perms
This commit is contained in:
@@ -35,10 +35,12 @@ import {
|
||||
} from "~/utils/remix.server";
|
||||
import { vodVideoPage } from "~/utils/urls";
|
||||
import { actualNumber, id } from "~/utils/zod";
|
||||
import { Alert } from "../../../components/Alert";
|
||||
import { DateFormField } from "../../../components/form/DateFormField";
|
||||
import { MyForm } from "../../../components/form/MyForm";
|
||||
import { SelectFormField } from "../../../components/form/SelectFormField";
|
||||
import { TextFormField } from "../../../components/form/TextFormField";
|
||||
import { useUser } from "../../auth/core/user";
|
||||
import { createVod, updateVodByReplacing } from "../queries/createVod.server";
|
||||
import { findVodById } from "../queries/findVodById.server";
|
||||
import { videoMatchTypes } from "../vods-constants";
|
||||
@@ -127,9 +129,18 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {
|
||||
export type VodFormFields = z.infer<typeof videoInputSchema>;
|
||||
|
||||
export default function NewVodPage() {
|
||||
const user = useUser();
|
||||
const data = useLoaderData<typeof loader>();
|
||||
const { t } = useTranslation(["vods"]);
|
||||
|
||||
if (!user || !user.isVideoAdder) {
|
||||
return (
|
||||
<Main className="stack items-center">
|
||||
<Alert variation="WARNING">{t("vods:gainPerms")}</Alert>
|
||||
</Main>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Main halfWidth>
|
||||
<MyForm
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"forms.action.addMatch": "Add match",
|
||||
"forms.action.deleteMatch": "Delete match",
|
||||
"noVods": "No videos found matching this filter. Are we missing something? See the FAQ page on information about how to gain VoD uploading permissions.",
|
||||
"gainPerms": "Please post on the helpdesk of our Discord to gain permissions to upload videos.",
|
||||
"gainPerms": "Please post on the helpdesk of our Discord to gain permissions to upload videos",
|
||||
"deleteConfirm": "Delete video with the title '{{title}}'?"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user