Prevented the word limit toast to duplicate
This commit is contained in:
@@ -30,7 +30,7 @@ export default function Writing({exam}: Props) {
|
|||||||
} else {
|
} else {
|
||||||
setIsSubmitEnabled(true);
|
setIsSubmitEnabled(true);
|
||||||
if (wordCounter.limit < words.length) {
|
if (wordCounter.limit < words.length) {
|
||||||
toast.warning(`You have reached your word limit of ${wordCounter.limit} words!`);
|
toast.warning(`You have reached your word limit of ${wordCounter.limit} words!`, {toastId: "word-limit"});
|
||||||
setInputText(words.slice(0, words.length - 1).join(" "));
|
setInputText(words.slice(0, words.length - 1).join(" "));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ export default function Writing({exam}: Props) {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<textarea
|
<textarea
|
||||||
className="w-1/2 h-1/3 cursor-text p-2 input input-bordered"
|
className="w-1/2 h-1/3 cursor-text p-2 input input-bordered bg-white"
|
||||||
onChange={(e) => setInputText(e.target.value)}
|
onChange={(e) => setInputText(e.target.value)}
|
||||||
value={inputText}
|
value={inputText}
|
||||||
placeholder="Write your text here..."
|
placeholder="Write your text here..."
|
||||||
|
|||||||
Reference in New Issue
Block a user