feat(settings): remove the platform mails switch

Broadcasts go to every active user, so the settings switch and its API
call are gone. Admin broadcast texts no longer mention an opt-out.
This commit is contained in:
lobo committed 2026-10-02 07:53:35 +02:00
1 parent 6dda186bdf
commit 80259cb0e9
8 files changed
+19 -60

No files matched your search

+1 -16
View File
@@ -11,7 +11,7 @@ import {usePreferences} from '../context/PreferencesContext.jsx';
import usePersistSettings from '../hooks/usePersistSettings.js';
import useSaveResponse from '../hooks/useSaveResponse.js';
import {FAVORITE_PLATFORMS, saveFavoritePlatform} from '../utils/platforms.js';
import {LANGUAGES, savePlatformMails, saveSettings} from '../utils/settings.js';
import {LANGUAGES, saveSettings} from '../utils/settings.js';
// Radix Select has no empty value.
const NO_FAVORITE = 'NONE';
@@ -41,13 +41,6 @@ export default function PreferencesCard() {
}
};
const handlePlatformMailsChange = async (next) => {
if (await runSave(() => savePlatformMails(next))) {
updateProfile((p) => ({...p, settings: {...p.settings, platformMails: next}}));
toast.success(t('SETTINGS.SAVED'));
}
};
return (
<Card>
<CardHeader>
@@ -90,14 +83,6 @@ export default function PreferencesCard() {
</SelectContent>
</Select>
</div>
<div className="flex items-center justify-between gap-4">
<div className="space-y-1">
<Label htmlFor="platformMails">{t('SETTINGS.PLATFORM_MAILS')}</Label>
<p className="text-xs text-muted-foreground">{t('SETTINGS.PLATFORM_MAILS_HINT')}</p>
</div>
<Switch id="platformMails" checked={profile?.settings?.platformMails ?? true}
onCheckedChange={handlePlatformMailsChange}/>
</div>
</CardContent>
</Card>
);