Skip to content

Commit fb1086a

Browse files
committed
Notifcation Bug Fix + Comments Removed
1 parent bf2a426 commit fb1086a

3 files changed

Lines changed: 10 additions & 13 deletions

File tree

frontend/components/Course/CourseWrapper.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ const CourseWrapper = ({ render, ...props }: CourseProps) => {
4646
useEffect(() => setSupportsNotifs(browserSupportsNotifications()), []);
4747

4848
const toggleNotifs = () => {
49-
setNotifs(!notifs);
50-
localStorage.setItem("notifs", !notifs ? "true" : "false");
49+
const newNotifs = !notifs;
50+
setNotifs(newNotifs);
51+
localStorage.setItem("notifs", newNotifs ? "true" : "false");
5152
document.body.focus();
5253
};
5354

frontend/components/Course/InstructorQueuePage/QueueFormFields.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const QueueFormFields = ({
181181

182182
return (
183183
<>
184-
<Form.Field>
184+
<Form.Field required>
185185
<label htmlFor="form-name">Name</label>
186186
<Form.Input
187187
id="form-name"
@@ -199,7 +199,7 @@ const QueueFormFields = ({
199199
{`Characters: ${nameCharCount}/100`}
200200
</div>
201201
</Form.Field>
202-
<Form.Field>
202+
<Form.Field required>
203203
<label htmlFor="form-desc">Description</label>
204204
<Form.TextArea
205205
id="form-desc"
@@ -410,6 +410,11 @@ const QueueFormFields = ({
410410
width={2}
411411
size="mini"
412412
type="number"
413+
onKeyPress={(event) => {
414+
if (!/[0-9]/.test(event.key)) {
415+
event.preventDefault();
416+
}
417+
}}
413418
min="1"
414419
id="timer-questions"
415420
error={!validQuestionTime}

frontend/types.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,6 @@ export type Queue = BaseQueue &
104104
}
105105
>;
106106

107-
// export type Queue =
108-
// | (BaseQueue & { rateLimitEnabled: false })
109-
// | (BaseQueue & {
110-
// rateLimitEnabled: true;
111-
// rateLimitLength: number;
112-
// rateLimitQuestions: number;
113-
// rateLimitMinutes: number;
114-
// });
115-
116107
// "ASKED" "WITHDRAWN" "ACTIVE" "REJECTED" "ANSWERED"
117108
export enum QuestionStatus {
118109
ASKED = "ASKED",

0 commit comments

Comments
 (0)