From f6a75d89cda694b431b6d44eb6d42325306588b7 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Wed, 15 Nov 2023 13:26:32 +1300 Subject: [PATCH] =?UTF-8?q?Write=20an=20empty=20mp3=20when=20disabling=20s?= =?UTF-8?q?ound=20-=201.188=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also revert to the default sound if you enable it again. Closes #178 --- SettingsPage.tsx | 11 +++++++++++ android/app/build.gradle | 4 ++-- package.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/SettingsPage.tsx b/SettingsPage.tsx index 72d5119..dbe6abb 100644 --- a/SettingsPage.tsx +++ b/SettingsPage.tsx @@ -308,6 +308,17 @@ export default function SettingsPage() { value={settings.noSound} onChange={async (value) => { setValue("noSound", value); + const silentPath = Dirs.DocumentDir + "/silent.mp3"; + + if (value) { + await FileSystem.writeFile(silentPath, ""); + setValue("sound", silentPath); + await update("sound", silentPath); + } else if (!value && settings.sound === silentPath) { + setValue("sound", null); + await update("sound", null); + } + await update("noSound", value); if (value) toast("Alarms will no longer make a sound."); else toast("Enabled sound for alarms."); diff --git a/android/app/build.gradle b/android/app/build.gradle index c33677f..40f4b86 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -85,8 +85,8 @@ android { applicationId "com.massive" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 36213 - versionName "1.187" + versionCode 36214 + versionName "1.188" } signingConfigs { release { diff --git a/package.json b/package.json index 129dad6..350708f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "massive", - "version": "1.187", + "version": "1.188", "private": true, "license": "GPL-3.0-only", "scripts": {