Skip to content

Commit

Permalink
fix autopause message
Browse files Browse the repository at this point in the history
  • Loading branch information
wwww-wwww committed Jul 4, 2022
1 parent b798ce5 commit 1c8a488
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/grasstube/video.ex
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ defmodule Grasstube.VideoAgent do

def autopaused?(pid), do: Agent.get(pid, & &1.autopaused)

def autopause?(pid) do
def autopause?(pid), do: Agent.get(pid, & &1.autopause)

def can_autopause?(pid) do
Agent.get(
pid,
&(&1.autopause and &1.current_video != :nothing and &1.current_video.type == "default")
Expand Down
2 changes: 1 addition & 1 deletion lib/grasstube_web/live/video_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ defmodule GrasstubeWeb.VideoLive do
buffered: buffered
})

if VideoAgent.autopause?(socket.assigns.video) do
if VideoAgent.can_autopause?(socket.assigns.video) do
if buffered > 0 do
Presence.list(socket.assigns.topic)
|> Enum.map(&elem(&1, 1))
Expand Down

0 comments on commit 1c8a488

Please sign in to comment.