Skip to content

Commit 5b757ba

Browse files
authored
Merge pull request #64 from whentao/main
Fix wrong state changing when error happens
2 parents 885d452 + 06c7558 commit 5b757ba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/sources/source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class Source<T extends Object = {}> extends EventEmitterMixin<Events, typ
150150
this.state = 'READY';
151151
this.trigger('load', undefined);
152152
} catch (e) {
153-
this.state == 'ERROR';
153+
this.state = 'ERROR';
154154
this.trigger('error', new Error(String(e)));
155155
throw e;
156156
}

src/sources/video.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export class VideoSource<T extends Object = {}> extends AudioSource<T> {
8080
this.file = new File([blob], this.name, { type: blob.type });
8181
this.trigger('load', undefined);
8282
} catch (e) {
83-
this.state == 'ERROR';
83+
this.state = 'ERROR';
8484
this.trigger('error', new Error(String(e)));
8585
} finally {
8686
this.downloadInProgress = false;

0 commit comments

Comments
 (0)