(collection: Collection, slug: string)
| 942 | } |
| 943 | |
| 944 | async deleteLocalDraftBackup(collection: Collection, slug: string) { |
| 945 | try { |
| 946 | await this.backupSync.acquire(); |
| 947 | await localForage.removeItem(getEntryBackupKey(collection.get('name'), slug)); |
| 948 | // delete new entry backup if not deleted |
| 949 | slug && (await localForage.removeItem(getEntryBackupKey(collection.get('name')))); |
| 950 | const result = await this.deleteAnonymousBackup(); |
| 951 | return result; |
| 952 | } catch (e) { |
| 953 | console.warn('deleteLocalDraftBackup', e); |
| 954 | } finally { |
| 955 | this.backupSync.release(); |
| 956 | } |
| 957 | } |
| 958 | |
| 959 | // Unnamed backup for use in the global error boundary, should always be |
| 960 | // deleted on cms load. |
no test coverage detected