Write an empty mp3 when disabling sound - 1.188 🚀

Also revert to the default sound if you enable it again.

Closes #178
This commit is contained in:
Brandon Presley 2023-11-15 13:26:32 +13:00
parent 0592a9d695
commit f6a75d89cd
3 changed files with 14 additions and 3 deletions

View File

@ -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.");

View File

@ -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 {

View File

@ -1,6 +1,6 @@
{
"name": "massive",
"version": "1.187",
"version": "1.188",
"private": true,
"license": "GPL-3.0-only",
"scripts": {