const seedTimeout = 60000; import { webtorrent, base_host } from '$/client/config.js'; import assert from "$/client/assert.js"; import { log } from "$/client/logging.js"; /* This needs an entire rewrite using the FSM code. Most of this is hacked on * garbage that is unreliable at the best of times. */ // WARNING: having svelte build the webtorrent client into the script makes it slow to load and massive. // it's much faster to set it as a script variable in the index.html but that might cause loading problems // WebTorrent then comes from the public/index.html file, not from an import in here let LAZY_CLIENT; // this is lazy loaded by getClient const getClient = () => { // super hacks! if(LAZY_CLIENT) { return LAZY_CLIENT; } else { // eslint will complain but webtorrent is loaded by