From 0c9a49a9c3ab2db12e076e38fb8d9c291ca08a47 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 9 Oct 2023 22:38:09 +0100 Subject: [PATCH] Solved an oopsie --- src/pages/(admin)/BatchCodeGenerator.tsx | 2 +- src/pages/(admin)/Lists/GroupList.tsx | 2 +- tsconfig.json | 23 ++++++++++++++++++----- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/pages/(admin)/BatchCodeGenerator.tsx b/src/pages/(admin)/BatchCodeGenerator.tsx index 518aadd9..a48b05e4 100644 --- a/src/pages/(admin)/BatchCodeGenerator.tsx +++ b/src/pages/(admin)/BatchCodeGenerator.tsx @@ -28,7 +28,7 @@ export default function BatchCodeGenerator() { return; } - setEmails(emails); + setEmails([...new Set(emails)]); } }, [filesContent]); diff --git a/src/pages/(admin)/Lists/GroupList.tsx b/src/pages/(admin)/Lists/GroupList.tsx index 18bf4f00..f7e3bed4 100644 --- a/src/pages/(admin)/Lists/GroupList.tsx +++ b/src/pages/(admin)/Lists/GroupList.tsx @@ -48,7 +48,7 @@ const CreatePanel = ({user, users, group, onCreate}: CreateDialogProps) => { return; } - const emailUsers = emails.map((x) => users.find((y) => y.email.toLowerCase() === x)).filter((x) => x !== undefined); + const emailUsers = [...new Set(emails)].map((x) => users.find((y) => y.email.toLowerCase() === x)).filter((x) => x !== undefined); const filteredUsers = emailUsers.filter( (x) => ((user.type === "developer" || user.type === "owner" || user.type === "admin") && diff --git a/tsconfig.json b/tsconfig.json index 2159bf45..c1806359 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -15,10 +19,19 @@ "jsx": "preserve", "incremental": true, "baseUrl": ".", + "downlevelIteration": true, "paths": { - "@/*": ["./src/*"] + "@/*": [ + "./src/*" + ] } }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] -} + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file