Skip to content

Commit f548139

Browse files
[FIX] discuss: prevent warning for expected video error
Before this commit, it was possible to have a `videoError` caused by (or happening during) the destruction of the video component. This error should not be retained as playing the video is no longer useful when the component is destroyed. closes odoo#204941 X-original-commit: 941306a Signed-off-by: Didier Debondt (did) <did@odoo.com> Signed-off-by: Thanh Son Dodeur (tso) <tso@odoo.com>
1 parent df457d2 commit f548139

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

addons/mail/static/src/discuss/call/common/call_participant_video.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, onMounted, onPatched, useExternalListener, useRef } from "@odoo/owl";
1+
import { Component, onMounted, onPatched, status, useExternalListener, useRef } from "@odoo/owl";
22
import { useService } from "@web/core/utils/hooks";
33

44
/**
@@ -38,6 +38,9 @@ export class CallParticipantVideo extends Component {
3838
await this.root.el?.play?.();
3939
this.props.session.videoError = undefined;
4040
} catch (error) {
41+
if (status(this) === "destroyed") {
42+
return;
43+
}
4144
this.props.session.videoError = error.name;
4245
}
4346
}

0 commit comments

Comments
 (0)