Change coordinate checker link.
Add logger messages when users press the button.
This commit is contained in:
parent
f71c0f0d63
commit
0087b4dca8
2 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
defmodule UiWeb.MorseLive do
|
defmodule UiWeb.MorseLive do
|
||||||
use Phoenix.LiveView
|
use Phoenix.LiveView
|
||||||
|
require Logger
|
||||||
|
|
||||||
@topic "morse_progress"
|
@topic "morse_progress"
|
||||||
|
|
||||||
|
@ -13,7 +14,10 @@ defmodule UiWeb.MorseLive do
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_event("toggle_morse", _value, %{assigns: %{ip: ip}} = socket) do
|
def handle_event("toggle_morse", _value, %{assigns: %{ip: ip}} = socket) do
|
||||||
|
Logger.info("#{ip} pressed the button!")
|
||||||
|
|
||||||
if not Morse.Server.in_progress?() and ip_send_message?(ip) do
|
if not Morse.Server.in_progress?() and ip_send_message?(ip) do
|
||||||
|
Logger.info("Sending Telegram message.")
|
||||||
spawn(fn -> Ui.TelegramBot.message("#{ip} pressed the button!") end)
|
spawn(fn -> Ui.TelegramBot.message("#{ip} pressed the button!") end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a href="http://www.geochecker.com/index.php?code=d9dbdc4542a4911a5f81a51bc9312a35&action=check&wp=47433743363432&name=4573726f6d">en: check your coordinate on GeoChecker.com nl: controleer je coördinaat op GeoChecker.</a>
|
<a href="http://www.geochecker.com/index.php?code=04dca0fd7e631e7ea5076489713e27eb&action=check&wp=47433743363432&name=4573726f6d">en: check your coordinate on GeoChecker.com nl: controleer je coördinaat op GeoChecker.</a>
|
||||||
<br>
|
<br>
|
||||||
<br>
|
<br>
|
||||||
<button phx-click="toggle_hint" id="hintButton">Click here for a hint!</button>
|
<button phx-click="toggle_hint" id="hintButton">Click here for a hint!</button>
|
||||||
|
|
Loading…
Reference in a new issue