|
1 | 1 | /* eslint-disable camelcase -- mirrors SCEvents JSON field names in state and payloads */ |
2 | 2 | import React, { useMemo, useState, useEffect } from 'react'; |
3 | | -import { Link, useHistory, useParams, Redirect } from 'react-router-dom'; |
| 3 | +import { Link, useHistory, useParams } from 'react-router-dom'; |
4 | 4 | import { useSCE } from '../../Components/context/SceContext.js'; |
5 | 5 | import { getEventByID, updateSCEvent } from '../../APIFunctions/SCEvents.js'; |
6 | 6 | import CreateEventFormQuestionBlock from './CreateEventFormQuestionBlock.js'; |
7 | 7 | import { membershipState } from '../../Enums'; |
8 | | -import config from '../../config/config.json'; |
9 | 8 |
|
10 | 9 | /** Matches SCEvents `max_attendees` when there is no cap. */ |
11 | 10 | const UNLIMITED_ATTENDEES = -1; |
@@ -46,7 +45,6 @@ export default function EditEventPage() { |
46 | 45 | const { id } = useParams(); |
47 | 46 | const { user } = useSCE(); |
48 | 47 | const history = useHistory(); |
49 | | - const isSCEventsEnabled = config.SCEvents?.ENABLED; |
50 | 48 |
|
51 | 49 | const [isLoading, setIsLoading] = useState(true); |
52 | 50 | const [fetchError, setFetchError] = useState(''); |
@@ -96,12 +94,8 @@ export default function EditEventPage() { |
96 | 94 | setEventAdmins(evt.admins || []); |
97 | 95 | } |
98 | 96 |
|
99 | | - if (!isSCEventsEnabled) { |
100 | | - return; |
101 | | - } |
102 | | - |
103 | 97 | loadEvent(); |
104 | | - }, [id, isSCEventsEnabled]); |
| 98 | + }, [id]); |
105 | 99 |
|
106 | 100 | function addQuestion() { |
107 | 101 | setQuestions((prev) => [...prev, newQuestionTemplate()]); |
@@ -229,10 +223,6 @@ export default function EditEventPage() { |
229 | 223 | history.push('/events'); |
230 | 224 | } |
231 | 225 |
|
232 | | - if (!isSCEventsEnabled) { |
233 | | - return <Redirect to="/notfound" />; |
234 | | - } |
235 | | - |
236 | 226 | if (!isOfficerOrAdmin) { |
237 | 227 | return ( |
238 | 228 | <div className="m-10"> |
|
0 commit comments