From 72c6a8b900bd60827c442dca2efcddbf5ab8eef5 Mon Sep 17 00:00:00 2001 From: Tony <97451137+TonybynMp4@users.noreply.github.com> Date: Mon, 12 Feb 2024 02:00:38 +0100 Subject: [PATCH] fix: de/in-crease channel buttons modify the html input --- client/main.lua | 4 ++-- html/js/script.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index e1113a9..fe70f78 100644 --- a/client/main.lua +++ b/client/main.lua @@ -163,7 +163,7 @@ RegisterNUICallback('increaseradiochannel', function(_, cb) radioChannel += 1 exports['pma-voice']:setRadioChannel(radioChannel) exports.qbx_core:Notify(locale('new_channel')..radioChannel, 'success') - cb('ok') + cb(radioChannel) end) RegisterNUICallback('decreaseradiochannel', function(_, cb) @@ -173,7 +173,7 @@ RegisterNUICallback('decreaseradiochannel', function(_, cb) exports['pma-voice']:setRadioChannel(radioChannel) exports.qbx_core:Notify(locale('new_channel')..radioChannel, 'success') - cb('ok') + cb(radioChannel) end) RegisterNUICallback('toggleClicks', function(_, cb) diff --git a/html/js/script.js b/html/js/script.js index 37cd759..fe7ac21 100644 --- a/html/js/script.js +++ b/html/js/script.js @@ -83,6 +83,8 @@ window.addEventListener('DOMContentLoaded', function () { body: JSON.stringify({ channel: document.getElementById("channel").value }) + }).then(response => response.json()).then(newChannel => { + document.getElementById("channel").value = newChannel; }); }); @@ -94,6 +96,8 @@ window.addEventListener('DOMContentLoaded', function () { body: JSON.stringify({ channel: document.getElementById("channel").value }) + }).then(response => response.json()).then(newChannel => { + document.getElementById("channel").value = newChannel; }); });