Free stroage if it is exceeding disk quota (#7061)
This commit is contained in:
parent
b83ce18b30
commit
1ed1014546
6 changed files with 89 additions and 36 deletions
|
@ -1,15 +1,14 @@
|
|||
import { me } from '../initial_state';
|
||||
|
||||
export default new Promise((resolve, reject) => {
|
||||
export default () => new Promise((resolve, reject) => {
|
||||
// ServiceWorker is required to synchronize the login state.
|
||||
// Microsoft Edge 17 does not support getAll according to:
|
||||
// Catalog of standard and vendor APIs across browsers - Microsoft Edge Development
|
||||
// https://developer.microsoft.com/en-us/microsoft-edge/platform/catalog/?q=specName%3Aindexeddb
|
||||
if (!me || !('getAll' in IDBObjectStore.prototype)) {
|
||||
if (!('caches' in self && 'getAll' in IDBObjectStore.prototype)) {
|
||||
reject();
|
||||
return;
|
||||
}
|
||||
|
||||
const request = indexedDB.open('mastodon:' + me);
|
||||
const request = indexedDB.open('mastodon');
|
||||
|
||||
request.onerror = reject;
|
||||
request.onsuccess = ({ target }) => resolve(target.result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue