fix: try to reduce initial load lag

This commit is contained in:
ThaUnknown 2022-06-07 15:34:04 +02:00
parent 450c6d6311
commit 15e8ecf357
3 changed files with 7 additions and 3387 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "Miru", "name": "Miru",
"version": "2.4.5", "version": "2.4.6",
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>", "author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
"main": "src/index.js", "main": "src/index.js",
"homepage": "https://github.com/ThaUnknown/miru#readme", "homepage": "https://github.com/ThaUnknown/miru#readme",
@ -109,7 +109,7 @@
"pump": "^3.0.0", "pump": "^3.0.0",
"range-parser": "^1.2.1", "range-parser": "^1.2.1",
"svelte-keybinds": "^1.0.4", "svelte-keybinds": "^1.0.4",
"svelte-miniplayer": "^1.0.1", "svelte-miniplayer": "^1.0.2",
"webtorrent": "^1.8.14" "webtorrent": "^1.8.14"
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -45,7 +45,9 @@ client.on('torrent', ({ detail }) => {
// load last used torrent // load last used torrent
queueMicrotask(() => { queueMicrotask(() => {
if (localStorage.getItem('torrent')) { setTimeout(() => {
client.send('torrent', JSON.parse(localStorage.getItem('torrent'))) if (localStorage.getItem('torrent')) {
} client.send('torrent', JSON.parse(localStorage.getItem('torrent')))
}
}, 3000)
}) })