padwhen / language-learning-app

Automatically handle users' queries to flashcards, implementing with a spaced-repetition algorithm. Made with TypeScript, OpenAI API, MongoDB,..
https://padwhen-learningapp.fly.dev/
0 stars 0 forks source link

Checking if the term is added anywhere else #41

Open padwhen opened 2 months ago

padwhen commented 2 months ago

Bugs:

Additional features:

padwhen commented 2 months ago

For example, there are 2 terms that are the same. So both will have a notification about the duplication, however, if I delete one, the other term will still have the warning about the duplication

The duplication warning persists even after deleting one of the duplicate terms because the application checks against the decks from useContext(DeckContext), which isn't consistently updated. This results in the warning still being shown since the context still reflects the old state.

To resolve this, I created a local copy of decks and made sure to check and update against this local variable. This way, the duplication status is accurately reflected based on the most recent changes.