|
1 | 1 | import deleteImg from '../../images/delete.png'; |
2 | | -import soundfile from '../../assets/Notification.wav'; |
| 2 | +import notificationSound from '../../assets/Notification.wav'; |
3 | 3 | import { AppLogic } from './logic/app.logic'; |
4 | 4 | import * as AppCommon from './logic/lib/app.common'; |
5 | 5 | import * as Test from '../components/dialogbox/custompopup'; |
@@ -55,6 +55,23 @@ export function Init() { |
55 | 55 | } |
56 | 56 | }); |
57 | 57 |
|
| 58 | + const muteNotifcationElement = document.getElementById('chk-mute-notification'); |
| 59 | + const notifcationMute = window.localStorage.getItem('muteNotification'); |
| 60 | + |
| 61 | + if((!!notifcationMute) === false) { |
| 62 | + window.localStorage.setItem('muteNotification', 1); |
| 63 | + } |
| 64 | + |
| 65 | + muteNotifcationElement.checked = parseInt(notifcationMute) === 1; |
| 66 | + |
| 67 | + muteNotifcationElement.addEventListener('change', (event) => { |
| 68 | + if (event.target.checked) { |
| 69 | + window.localStorage.setItem('muteNotification', 0); |
| 70 | + } else { |
| 71 | + window.localStorage.setItem('muteNotification', 1); |
| 72 | + } |
| 73 | + }); |
| 74 | + |
58 | 75 | document.getElementById('btn-clearlogs') |
59 | 76 | .addEventListener('click', (event) => { |
60 | 77 | document.getElementById("app-logs").innerHTML = ""; |
@@ -324,7 +341,6 @@ function TextboxValidation(element, errorMessage) { |
324 | 341 | export function OnConnect() { |
325 | 342 |
|
326 | 343 | //Add validation |
327 | | - debugger; |
328 | 344 | if(!UrlValidation()) { |
329 | 345 | return; |
330 | 346 | } |
@@ -357,9 +373,20 @@ export function OnConnected() { |
357 | 373 | } |
358 | 374 |
|
359 | 375 | export function HandleResponse(data) { |
360 | | - document.querySelector("#inputResponseData").value += JSON.stringify(data) + '\n'; |
361 | | - let sound = new Audio(soundfile); |
362 | | - sound.play(); |
| 376 | + document.querySelector("#inputResponseData").value += JSON.stringify(data) + '\n'; |
| 377 | + var isNotificationMute = window.localStorage.getItem('muteNotification'); |
| 378 | + |
| 379 | + // if((!!isNotificationMute) === false) { |
| 380 | + // window.localStorage.setItem('muteNotification', 1); |
| 381 | + // isNotificationMute = 1 |
| 382 | + // } |
| 383 | + |
| 384 | + debugger; |
| 385 | + if(parseInt(isNotificationMute) === 1) { |
| 386 | + let sound = new Audio(notificationSound); |
| 387 | + sound.play(); |
| 388 | + } |
| 389 | + |
363 | 390 | } |
364 | 391 |
|
365 | 392 | export function SetConnectionProtocol() { |
@@ -414,8 +441,7 @@ export function Disconnect() { |
414 | 441 | export function SendPayload() { |
415 | 442 |
|
416 | 443 | const methodNameElement = document.getElementById("inputServerMethod"); |
417 | | - var methodName = methodNameElement.value; |
418 | | - debugger; |
| 444 | + var methodName = methodNameElement.value; |
419 | 445 | if(!TextboxValidation(methodNameElement, "Please enter the Hub method name")) { |
420 | 446 | return false; |
421 | 447 | } |
|
0 commit comments