Skip to content

Commit

Permalink
fix(overlay): disabling logic if overlay is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
BrooklynKing committed Jul 8, 2019
1 parent 89eb523 commit bf1ef35
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/modules/ui/overlay/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Overlay implements IOverlay {

private _updatePlayingState({ nextState }: { nextState: EngineState }) {
if (nextState === EngineState.PLAY_REQUESTED) {
this._hideContent();
this._tryHideContent();
} else if (
nextState === EngineState.ENDED ||
nextState === EngineState.SRC_SET
Expand All @@ -113,11 +113,23 @@ class Overlay implements IOverlay {
}

private _tryShowContent() {
if (this.isHidden) {
return;
}

if (this._engine.isPaused) {
this._showContent();
}
}

private _tryHideContent() {
if (this.isHidden) {
return;
}

this._hideContent();
}

private _hideContent() {
this.view.hideContent();
this._loader.show();
Expand Down

0 comments on commit bf1ef35

Please sign in to comment.