Skip to content
This repository was archived by the owner on Mar 30, 2025. It is now read-only.

Commit 29c10aa

Browse files
committed
Add token handling.
1 parent 46d3baa commit 29c10aa

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

static/js/mlestalk.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,11 @@ $(document).ready(function() {
258258

259259
function ask_channel() {
260260
if ($('#input_name').val().trim().length <= 0 ||
261-
(mytoken == null && $('#input_channel').val().trim().length <= 0) ||
261+
mytoken == null ||
262262
$('#input_key').val().trim().length <= 0 ) {
263263

264264
//not enough input, alert
265-
pop_alert();
265+
pop_alert(mytoken);
266266

267267
} else {
268268
if(!initOk) {
@@ -966,7 +966,12 @@ function set_language() {
966966
}
967967
}
968968

969-
function pop_alert() {
969+
function pop_alert(mytoken) {
970+
if(mytoken == null) {
971+
alert('Token is missing!');
972+
return;
973+
}
974+
970975
var language = $("#channel_localization").val();
971976
switch(language) {
972977
case "fi":

0 commit comments

Comments
 (0)