Skip to content

Commit 8474dd6

Browse files
authored
Modified Telegram integration (settings) UI (#4)
* TG settings updated * Removed some debugging console.log()s
1 parent fa57478 commit 8474dd6

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

app/main.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ window.genUUID = async function genUUID () {
210210
};
211211

212212
window.fetchChatID = async function fetchChatID (botAPIKey) {
213-
console.log('Fetching Telegram chat ID' + botAPIKey);
214213
try {
215214
const TGchatID = await utils.chatIDTG(botAPIKey);
216215
document.getElementById('chatID').value = TGchatID;
@@ -393,12 +392,9 @@ window.signIn = async function signIn (callerForm) {
393392

394393
window.TGconfig = function TGconfig (callerForm) {
395394
const submitterBtn = callerForm.getElementsByTagName('button')[1];
396-
submitterBtn.replaceChildren('Saving...');
397-
setTimeout(() => { submitterBtn.replaceChildren('Save'); callerForm.reset(); }, 2000);
398395
const formData = new FormData(callerForm);
399396
const dataObj = {};
400397
for (const [key, val] of formData.entries()) {
401-
console.log(key + ',' + val);
402398
dataObj[key] = val;
403399
cache.setItem(key, val);
404400
}
@@ -481,7 +477,6 @@ function main() {
481477
const pageIsRefreshed = Boolean(sessionStorage.getItem('wasHere'));
482478
// Sets sessionStorage for next sessions to understand if its a page reload
483479
sessionStorage.setItem('wasHere', 'earlier');
484-
console.log('Current page is refreshed:', pageIsRefreshed);
485480
if (pageIsRefreshed) spaRestore();
486481

487482
// Sign-in automatically if prior cache is found in localStorage or sessionStorage.

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ <h3>Settings</h3>
220220
<form onsubmit="event.preventDefault();TGconfig(this);">
221221
<p>Setup Telegram notificiation in just 2 easy steps.</p>
222222
<label for="TGbotKey" class="form-label">1. Enter your Telegram Bot API Token (available from <a href="https://t.me/botfather">@BotFather</a>):</label>
223-
<input type="text" id="TGbotKey" name="TGbotKey" class="form-control" autocomplete="on" required>
224-
<input type="checkbox" id="togglePasswordVisibilityCBox1" onchange="togglePasswordVisibility('TGbotKey');" checked>
223+
<input type="password" id="TGbotKey" name="TGbotKey" class="form-control" autocomplete="on" required>
224+
<input type="checkbox" id="togglePasswordVisibilityCBox1" onchange="togglePasswordVisibility('TGbotKey');">
225225
<label for="togglePasswordVisibilityCBox1">Show</label>
226226
<br><br>
227227
<p>2. Send any text to the Bot. Then, click Fetch Chat ID.</p>

0 commit comments

Comments
 (0)