mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-19 13:32:04 +00:00
fix: last torrent loading on android
This commit is contained in:
parent
541dc831e6
commit
42e345f095
2 changed files with 9 additions and 1 deletions
|
|
@ -144,6 +144,7 @@ export function binarySearch (arr, el) {
|
|||
}
|
||||
|
||||
export const defaults = {
|
||||
volume: 1,
|
||||
playerAutoplay: true,
|
||||
playerPause: true,
|
||||
playerAutocomplete: true,
|
||||
|
|
|
|||
|
|
@ -96,7 +96,14 @@ export default class TorrentClient extends WebTorrent {
|
|||
|
||||
loadLastTorrent (t) {
|
||||
if (!localStorage.getItem('torrent') && !t) return
|
||||
const torrent = new Uint8Array(JSON.parse(localStorage.getItem('torrent'))) || t
|
||||
let torrent = localStorage.getItem('torrent') && new Uint8Array(JSON.parse(localStorage.getItem('torrent')))
|
||||
if (!torrent) {
|
||||
try {
|
||||
torrent = new Uint8Array(JSON.parse(t))
|
||||
} catch (e) {
|
||||
torrent = t
|
||||
}
|
||||
}
|
||||
if (torrent) this.addTorrent(torrent, JSON.parse(localStorage.getItem('lastFinished')))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue