mirror of
https://github.com/algora-io/tv.git
synced 2025-03-27 20:20:18 +02:00
fix(bug): allow index to load when there are no ads (#89)
This commit is contained in:
parent
816781021c
commit
bf8c6ac49c
@ -159,6 +159,10 @@ defmodule Algora.Ads do
|
|||||||
|> Repo.insert()
|
|> Repo.insert()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_current_index([]) do
|
||||||
|
0
|
||||||
|
end
|
||||||
|
|
||||||
def get_current_index(ads) do
|
def get_current_index(ads) do
|
||||||
:os.system_time(:millisecond)
|
:os.system_time(:millisecond)
|
||||||
|> div(rotation_interval())
|
|> div(rotation_interval())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user