If we can't start indexeddb, fall back to a different store.
Previously we just ignored the exception and ploughed on anyway, on
the assumption that startup() was just for the indexeddb store to
load data anyway, and if that failed it would just do an initial
/sync instead (and also we'd keep trying to save the sync back which
would fail...). Then, in the previous release we started pulling
the settings out of the store on startup, making the assumpton that
the store actually worked, so the read obviously failed and the app
failed to start up.
This makes Riot work in Tor browser / firefox in daft mode again.
If we can't start indexeddb, fall back to a different store.
Previously we just ignored the exception and ploughed on anyway, on
the assumption that startup() was just for the indexeddb store to
load data anyway, and if that failed it would just do an initial
/sync instead (and also we'd keep trying to save the sync back which
would fail...). Then, in the previous release we started pulling
the settings out of the store on startup, making the assumpton that
the store actually worked, so the read obviously failed and the app
failed to start up.
This makes Riot work in Tor browser / firefox in daft mode again.
Fixes https://github.com/vector-im/riot-web/issues/7158
Because the onClick was on a fullpage div, the browser was firing it regardless of how far the mouse moved. The onClick event itself doesn't give us any sort of travel distance, or a start point we can use to determine if they clicked a scrollbar or something. This means we have to rely on good ol' fashioned mouse down and up events to see if the user moved their mouse during their click.
If the user's click starts in a valid container, we record the coordinates. This is so we can easily identify when the user clicks inside something like the settings container itself. When the user releases their mouse, we determine how far they moved their mouse - if the distance is within some threshold (~5 pixels in this case) then we can count it as a click. Because we've already filtered on the component they started their click in, we can safely rely on the presence of coordinates as a flag that they are in the right container, combined with the fact that they can't stray too far before their click not counting anyways.