Skip to content

Commit 7ccf4c5

Browse files
committed
fix: only fetch custom templates if allowed
1 parent 0d55295 commit 7ccf4c5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/routes/Boards/Templates/Templates.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ export const Templates = () => {
4444

4545
// init templates
4646
useEffect(() => {
47-
dispatch(getTemplates());
48-
}, [dispatch]);
47+
if (showCustomTemplates) {
48+
dispatch(getTemplates());
49+
}
50+
}, [dispatch, showCustomTemplates]);
4951

5052
const toggleFavourite = (templateId: string, favourite: boolean, type: "RECOMMENDED" | "CUSTOM") => {
5153
if (type === "RECOMMENDED") {

0 commit comments

Comments
 (0)