tokwatchr 0.6.4 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +2 -10
- package/package.json +1 -1
- package/src/TikTokLiveDownloader.ts +1 -8
package/dist/index.mjs
CHANGED
|
@@ -721,17 +721,9 @@ var TikTokLiveDownloader = class {
|
|
|
721
721
|
this.setState("stopping");
|
|
722
722
|
this.abortController.abort();
|
|
723
723
|
await new Promise((resolve) => {
|
|
724
|
-
let settled = false;
|
|
725
|
-
const timer = setTimeout(() => {
|
|
726
|
-
settled = true;
|
|
727
|
-
resolve();
|
|
728
|
-
}, 5e3);
|
|
729
724
|
const check = () => {
|
|
730
|
-
if (
|
|
731
|
-
|
|
732
|
-
clearTimeout(timer);
|
|
733
|
-
resolve();
|
|
734
|
-
} else setTimeout(check, 100);
|
|
725
|
+
if (this._state === "done") resolve();
|
|
726
|
+
else setTimeout(check, 100);
|
|
735
727
|
};
|
|
736
728
|
check();
|
|
737
729
|
});
|
package/package.json
CHANGED
|
@@ -178,17 +178,10 @@ export class TikTokLiveDownloader {
|
|
|
178
178
|
}
|
|
179
179
|
this.setState("stopping");
|
|
180
180
|
this.abortController.abort();
|
|
181
|
-
// Wait for
|
|
181
|
+
// Wait for _run()'s catch block to finish remux and set "done"
|
|
182
182
|
await new Promise<void>((resolve) => {
|
|
183
|
-
let settled = false;
|
|
184
|
-
const timer = setTimeout(() => {
|
|
185
|
-
settled = true;
|
|
186
|
-
resolve();
|
|
187
|
-
}, 5_000);
|
|
188
183
|
const check = () => {
|
|
189
|
-
if (settled) return;
|
|
190
184
|
if (this._state === "done") {
|
|
191
|
-
clearTimeout(timer);
|
|
192
185
|
resolve();
|
|
193
186
|
} else {
|
|
194
187
|
setTimeout(check, 100);
|