Addresses #3624.
This stores the flag in localStorage, after checking if localStorage is available. If localStorage is not available, the user will be prompted just like before this commit.
Signed-off-by: Travis Ralston <travpc@gmail.com>
This is a more sensible encoding for uploading logfiles, and will allow us to
compress the logfiles in future.
browser-request doesn't give us enough flexibility to do this properly, so we
use XMLHttpRequest directly.
*apparently* it's possible for your indexeddb transaction to complete in the
background, so that the `oncomplete` handler is never called. Make sure that
the oncomplete handler is set *before* doing the work.
As this makes it work out of the box with react-perf chrome
extension (which doesn't do a whole lot other than save you having
to remember the commands, but is still quite nice).
The promise would resolve immediately, nulling out `flushPromise`. This would
then immediately be set from `new Promise((resolve, reject) => {...})` turning
it back into non-null `flushPromise`. The resolve handler was called so the
next `flush()` would see "oh yes, there is a non-null `flushPromise`" then
promptly try to set `flushAgainPromise` which chains off the resolved
`flushPromise` which relied on `flushPromise` being `null`ed out after
`resolve()`, causing the chained `flush()` to see "oh yes, there is a non-null
`flushPromise`" which... ad infinitum.
This PR fixes it by making the nulling out asynchronous but the fact it took
me this long to debug this issue indicates to me that this is a terrible piece
of code. Will re-write.
This makes it easier to get a list of all the log IDs. It also makes it possible
to order the logs by the *LAST* log line and not the first as was the case
previously, which is important in the case of long-running tabs.
Merge the notification part of https://github.com/vector-im/riot-web/pull/2960
* Show and focus the window when the notification is clicked,
rather than just restoring it.
* Implement requestNotificationPermission and return a resolved
promise (although in practice it should never be called)