From 864b03b6e015628e561e61e699173bdbd7221578 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 8 Jul 2025 19:30:54 -0400 Subject: [PATCH] Fixed bug where tts and rate were not saving to the config file. Fixed bug that did not allow tts to be turned off. --- tojam | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tojam b/tojam index aea0682..b3791dd 100755 --- a/tojam +++ b/tojam @@ -226,10 +226,6 @@ configure_ninjam() { ;; "tts") if [[ "${tts}" == "true" ]]; then - ttsRate="$(dialog --backtitle "Tojam" \ - --rangebox "TTS Rate (0-10):" 8 50 0 10 "${ttsRate}" --stdout)" - menuCode=$? - [[ ${menuCode} -ne 0 ]] && continue tts="$(dialog --yes-label "Enable" \ --no-label "Disable" \ --yesno "Text-to-Speech is currently enabled at rate ${ttsRate}. Change setting?" -1 -1 --stdout)" @@ -237,6 +233,12 @@ configure_ninjam() { [[ ${tts} -eq 255 ]] && continue tts="${tts/0/true}" tts="${tts/1/false}" + if [[ "${tts}" == "true" ]]; then + ttsRate="$(dialog --backtitle "Tojam" \ + --rangebox "TTS Rate (0-10):" 8 50 0 10 "${ttsRate}" --stdout)" + menuCode=$? + [[ ${menuCode} -ne 0 ]] && continue + fi else tts="$(dialog --yes-label "Enable" \ --no-label "Keep Disabled" \ @@ -295,7 +297,10 @@ save_files() { tts_flags() { if [[ "${tts}" == "true" ]]; then - echo "-tts -tts-rate ${ttsRate}" + # Check if ninjam client supports TTS flags + if $ninjam --help 2>&1 | grep -q "\-tts"; then + echo "-tts -tts-rate ${ttsRate}" + fi fi }