Rewrite FileDigester to tidy up code, be able to delete files in OPFS onPageHide and on abort of file transfer

This commit is contained in:
schlagmichdoch 2024-07-14 18:04:03 +02:00
parent fa86212139
commit 76c47c9623
5 changed files with 346 additions and 127 deletions

View file

@ -25,6 +25,11 @@ class BrowserTabsConnector {
: false;
}
static isOnlyTab() {
let peerIdsBrowser = JSON.parse(localStorage.getItem('peer_ids_browser'));
return peerIdsBrowser.length <= 1;
}
static async addPeerIdToLocalStorage() {
const peerId = sessionStorage.getItem('peer_id');
if (!peerId) return false;