fixed capabilities.account when localStorage is disabled

This commit is contained in:
Danny Coates 2018-09-17 12:05:03 -07:00
parent 942457b357
commit 7dcf4bcdb9
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
2 changed files with 17 additions and 3 deletions

View file

@ -62,9 +62,15 @@ export default async function capabilities() {
const crypto = await checkCrypto();
const nativeStreams = checkStreams();
const polyStreams = nativeStreams ? false : polyfillStreams();
let account = false;
try {
account = !!localStorage;
} catch (e) {
// nevermind
}
return {
account: typeof localStorage !== 'undefined',
account,
crypto,
streamUpload: nativeStreams || polyStreams,
streamDownload: