mshumayl / ai-daleel

AI Daleel source code.
https://ai-daleel.vercel.app
1 stars 0 forks source link

Client-side check for bookmarks should not say `OUT_OF_BOOKMARK_QUOTA` if the verse has already been bookmarked #30

Open mshumayl opened 1 year ago

mshumayl commented 1 year ago

As per title. The offending lines are in VerseCard.tsx

//BUG: TODO: This should not display if the user has already bookmarked this. Deferring bug fix to another time.
      const message = "You are out of bookmarks quota. Remove existing bookmarks to add more."
      const result = "OUT_OF_BOOKMARK_QUOTA"
      if (setBookmarkResultCallback && setBookmarkMessageCallback) {
        setBookmarkResultCallback(result);
        setBookmarkMessageCallback(message);
      }

This can be fixed by checking if the database contains this saved verse in the same code block as the above.