As per comment
Unsure if this is the best fix - ideally we wouldn't go into no-controls
mode at all, but this part doesn't know whether the dialog is open so
the only thing we could really do is tweak the threshold, or possibly
guess based on width instead?
We called the 'unhold' function even if the button wasn't held which
probably will have been generating unmute events even when we weren't
muted.
Also use separate handlers for events so we can have specific log lines
(and also see where the event comes from when caught in the debugger).
Rather than every 30 seconds. This way we'll save logs for sessions
lasting less than 30 seconds which we previously didn't. Also save
on window unload just in case that doesn't catch everything.
Plus remove some more unused params.
* Remove duplicate copyright header
* Remove ts-ignores by just using the objects directly rather than via
event.target
* Use error.message rather than errorCode which TS doesn't know about
and may or may not exist.
* Remove some unused things like the skip rageshake function and
the option to init rageshakes without storage.
* Turn single function with a boolean param to make it take two entirely
separate code paths into two functions.
As per comment, we can't use workers in Vite dev mode. We previously
fell back to the memory store but this ends up with it working significantly
differently in dev mode to production, eg. dev mode would always start
by doing an initial sync, so old to-device messages would arrive again.
There's no need to fall all the way back to the memory store though,
we can use the IndexedDB store without the worker.
Since the app already determines when someone is speaking, we can use that information to make it less obvious when to-device messages are being slow to deliver mute state updates.
This is an Element project (in the vector-im repo) so the Copyright
should be for New Vector: it was incorrectly attributed to the
foundation for some files (and some files were missing headers).
We only ever used the static instance() method to get to the config
object, so just make a static instance that returns the ConfigOptions
directly, throwing an exception if it's not yet initialised. This way
the types can all be non-optional (plus it's shorter).