Fix issue with sometimes missing seconds_remaining field in Deepl response
This commit is contained in:
@ -58,7 +58,7 @@ defmodule Outlook.Translators.Deepl do
|
||||
%{status: "done"} ->
|
||||
response
|
||||
%{status: status} ->
|
||||
steps = response.seconds_remaining * 5
|
||||
steps = Map.get(response, :seconds_remaining, 1) * 5
|
||||
for n <- 0..steps do
|
||||
send(pid, {:progress, %{progress: 100 * n / steps, status: status}})
|
||||
Process.sleep 200
|
||||
|
||||
Reference in New Issue
Block a user