andyblarblar / queue_alert

A PWA that will send notifications whenever an amusement ride reaches a wait-time threshold.
https://qalert.ealovega.dev
MIT License
1 stars 0 forks source link

Sub is not removed if ride was added from a shared link #11

Closed andyblarblar closed 3 years ago

andyblarblar commented 3 years ago

https://github.com/andyblarblar/queue_alert/blob/6204f308e5bf37f477b877deccbaa3a35c8a4d8d/queue_alert_frontend/app/src/components/UseConfigSave.tsx#L22

Not sure why this occurs. Should be related to above line.

andyblarblar commented 3 years ago

This only occurs if the ride is immediately removed. If the ride is reloaded from the db, the error does not occur.

andyblarblar commented 3 years ago

It looks like this is caused not by the shared link, but by the trash can delete. The trash can delete doesn't reset the config when empty, preventing the park from becoming 'none'

andyblarblar commented 3 years ago

nvm this is caused by only a single shared ride being deleted by the trash can. It seems to be an issue with the table not rendering, and thus the unsub event not firing.

andyblarblar commented 3 years ago

It looks like swapping https://github.com/andyblarblar/queue_alert/blob/6204f308e5bf37f477b877deccbaa3a35c8a4d8d/queue_alert_frontend/app/src/components/configTable.tsx#L25 with https://github.com/andyblarblar/queue_alert/blob/6204f308e5bf37f477b877deccbaa3a35c8a4d8d/queue_alert_frontend/app/src/components/configTable.tsx#L32 may be solve this, as the config may be saved (and thus not none yet) before its reset. Effects are run in order.