micz / ThunderAI

ThunderAI is a Thunderbird Addon that uses the capabilities of ChatGPT or Ollama to enhance email management.
https://micz.it/thunderbird-addon-thunderai/
GNU General Public License v3.0
36 stars 9 forks source link

Improve async handling in closing the chat window #110

Closed micz closed 3 months ago

micz commented 3 months ago

api_webchat\messagesArea.js:238 - If you declare your event listener async, you can use await instead of then-chaining, which is considered to be the better approach.

js\mzta-chatgpt.js:170 - You are inside an async function, so you can (should actually) use await instead of then-chaining. Using then-chaining in async functions has the potential to introduce hard-to-track timing issues (not in this case, but in general).

Thanks to @jobisoft

micz commented 3 months ago

Fixed in 2.1.0.