From 0087b4dca8be4473d8f926d6fc809f0faf0c1834 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Fri, 17 Apr 2020 22:20:24 +0200 Subject: [PATCH] Change coordinate checker link. Add logger messages when users press the button. --- ui/lib/ui_web/live/morse_live.ex | 4 ++++ ui/lib/ui_web/templates/page/morse.html.leex | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/lib/ui_web/live/morse_live.ex b/ui/lib/ui_web/live/morse_live.ex index 34f9204..ecd6e25 100644 --- a/ui/lib/ui_web/live/morse_live.ex +++ b/ui/lib/ui_web/live/morse_live.ex @@ -1,5 +1,6 @@ defmodule UiWeb.MorseLive do use Phoenix.LiveView + require Logger @topic "morse_progress" @@ -13,7 +14,10 @@ defmodule UiWeb.MorseLive do end 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 + Logger.info("Sending Telegram message.") spawn(fn -> Ui.TelegramBot.message("#{ip} pressed the button!") end) end diff --git a/ui/lib/ui_web/templates/page/morse.html.leex b/ui/lib/ui_web/templates/page/morse.html.leex index 5c142c4..0dcfe06 100644 --- a/ui/lib/ui_web/templates/page/morse.html.leex +++ b/ui/lib/ui_web/templates/page/morse.html.leex @@ -14,7 +14,7 @@ -en: check your coordinate on GeoChecker.com nl: controleer je coördinaat op GeoChecker. +en: check your coordinate on GeoChecker.com nl: controleer je coördinaat op GeoChecker.