1

I am almost finished with project 3: mail of CS50w 2020. The only problem is that when I send a new mail to someone the sent page loads without showing the new mail I just sent. I added event.preventDefault(); so that the page doesn't reload to inbox. Any ideas?

1

This is probably not relevant to you anymore, but I had the same bug, and stumbled upon this question when googling, so it might help other people with this bug.

So you're calling load_mailbox('sent') at the end of your function for sending emails, right? As far as I can tell, the problem is that when you call load_mailbox('sent'), the new email you just sent has not been updated in the SQLite database yet. Try wrapping the call to load_mailbox in the setTimeout function, like so:

setTimeout(function(){ load_mailbox('sent'); }, 100}

The 100ms delay was sufficient in my case, and the outbox now shows the most recent email also.

1
  • Did you by any chance get stuck with sending mail? Thanks. – DevelopWithAP Apr 12 at 17:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .