diff options
author | Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> | 2018-05-13 20:48:32 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-05-13 13:48:32 +0200 |
commit | f1ed855f96f15ff4088cab9421dad31d81b22071 (patch) | |
tree | d87575dc21bd81a89371b0c8710258f6c753425c /app | |
parent | d9b2f84c92f24067b12be81837240bf6c8930236 (diff) |
Test if navigator.storage is present before using it (#7460)
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/storage/modifier.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/storage/modifier.js b/app/javascript/mastodon/storage/modifier.js index c2ed6f807..db1d16058 100644 --- a/app/javascript/mastodon/storage/modifier.js +++ b/app/javascript/mastodon/storage/modifier.js @@ -182,7 +182,9 @@ export function putStatuses(records) { } export function freeStorage() { - return navigator.storage.estimate().then(({ quota, usage }) => { + // navigator.storage is not present on: + // Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.100 Safari/537.36 Edge/16.16299 + return 'storage' in navigator && navigator.storage.estimate().then(({ quota, usage }) => { if (usage + storageMargin < quota) { return null; } |