Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FEC-14031): SHARE_EMBED_CLOSE is being sent upon every entry change in playlist #64

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,20 @@ class Share extends BasePlugin {
area: 'GuiArea',
presets: [ReservedPresetNames.Playback, ReservedPresetNames.Live, ReservedPresetNames.MiniAudioUI],
// eslint-disable-next-line react/display-name
get: () => <ShareComponent onClose={this._closeShareOverlay.bind(this)} config={this.config} videoDesc={videoDesc} />
get: () => (
<ShareComponent
onClose={(event, byKeyboard) => this._closeShareOverlay(event, byKeyboard, true)}
config={this.config}
videoDesc={videoDesc}
/>
)
})
);
}
this.dispatchEvent(ShareEvent.SHARE_CLICKED);
}

_closeShareOverlay(event?: OnClickEvent, byKeyboard?: boolean) {
_closeShareOverlay(event?: OnClickEvent, byKeyboard?: boolean, userInteraction = false) {
this._removeOverlay();
if (this._wasPlayed) {
this.player.play();
Expand All @@ -141,7 +147,9 @@ class Share extends BasePlugin {
// @ts-ignore
focusElement(this._pluginButtonRef);
}
this.dispatchEvent(ShareEvent.SHARE_CLOSE);
if (userInteraction) {
this.dispatchEvent(ShareEvent.SHARE_CLOSE);
}
}

_setPluginButtonRef(ref: HTMLButtonElement | null) {
Expand Down