(url: string)
| 582 | } |
| 583 | |
| 584 | async deleteInCache(url: string) { |
| 585 | await this.initDB(); // Make sure the DB is initialized |
| 586 | const transaction = this.db?.transaction(['urls'], 'readwrite'); |
| 587 | if (transaction === undefined) { |
| 588 | return; |
| 589 | } |
| 590 | const store = transaction.objectStore('urls'); |
| 591 | const request = store.delete(url); |
| 592 | // Await completion of the delete request |
| 593 | await new Promise<void>((resolve, reject) => { |
| 594 | request.onsuccess = () => resolve(); |
| 595 | request.onerror = () => reject(request.error); |
| 596 | }); |
| 597 | return; |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | /** |
no test coverage detected