diff --git a/src/app/(frontend)/intelligence/missions/actions.ts b/src/app/(frontend)/intelligence/missions/actions.ts index 4706cee..c9dc32f 100644 --- a/src/app/(frontend)/intelligence/missions/actions.ts +++ b/src/app/(frontend)/intelligence/missions/actions.ts @@ -234,6 +234,13 @@ export async function uploadSideOpModlist( return { success: true, data: { modlistId: created.id, modlistName: created.modlistName } }; } catch (error) { const message = error instanceof Error ? error.message : "Unknown error"; + if (/invalid: file/i.test(message)) { + return { + success: false, + error: + "That file type is not accepted. Please upload the .html file exported from the Arma 3 launcher, or a .txt mod list.", + }; + } return message === "Unauthorized" ? { success: false, error: "You must be logged in." } : { success: false, error: message }; diff --git a/src/collections/server/ModLists.ts b/src/collections/server/ModLists.ts index 5697bc5..0f2d835 100644 --- a/src/collections/server/ModLists.ts +++ b/src/collections/server/ModLists.ts @@ -29,6 +29,6 @@ export const ModLists: CollectionConfig = { }, ], upload: { - mimeTypes: ["text/html"], + mimeTypes: ["text/html", "text/plain"], }, }; diff --git a/src/components/frontend/intelligence/CreateSideOpDialog.tsx b/src/components/frontend/intelligence/CreateSideOpDialog.tsx index d93eda1..ecdd691 100644 --- a/src/components/frontend/intelligence/CreateSideOpDialog.tsx +++ b/src/components/frontend/intelligence/CreateSideOpDialog.tsx @@ -144,7 +144,7 @@ export function CreateSideOpDialog({ useEffect(() => { if (open) { setError(null); - setNarrativeOpen(initial !== undefined); + setNarrativeOpen(false); if (initial) { setName(initial.name); setCodeName(initial.codeName); @@ -174,6 +174,9 @@ export function CreateSideOpDialog({ }, [open, initial]); function narrativeInput() { + if (!narrativeOpen) { + return {}; + } return { briefing: narrative.briefing .filter((e) => e.sectionName.trim() !== "" || e.details.trim() !== "") @@ -469,7 +472,7 @@ export function CreateSideOpDialog({ { const file = e.target.files?.[0]; @@ -478,14 +481,15 @@ export function CreateSideOpDialog({ }} />
- Upload the HTML mod list exported from the Arma 3 launcher, or pick an existing one. + Upload the mod list file exported from the Arma 3 launcher (.html) or a .txt mod + list, or pick an existing one.