Suppression du système de notifications
- Plus de cloche sur l'accueil ni de panneau de notifications. - Plus de notifications push : réglage retiré, service worker sans push-sw.js, fonction send-push et script VAPID supprimés du dépôt. - Réglages « Notifications » retirés (et notifPrefs des réglages synchronisés). - Plus d'envoi des nouveaux épisodes au serveur pour les notifications. - Au lancement, l'appli résilie l'ancien abonnement push de l'appareil s'il en reste un. - Textes retirés des 18 langues ; politique de confidentialité mise à jour. - Serveur : migration 20261122120000_remove_notifications.sql (déjà appliquée en ligne) : plus aucune notification créée ni envoyée, données vidées. - Les demandes d'abonnement et invitations aux listes restent accessibles depuis le profil et les listes partagées. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
43 files changed
+62
-2298
No files matched your search
+2
-30
@@ -1,6 +1,6 @@
|
||||
import { useSocial } from '../components/social/SocialProvider'
|
||||
import { t } from '../i18n'
|
||||
import { Bell, CalendarDays, Dices, Plus } from 'lucide-react'
|
||||
import { CalendarDays, Dices, Plus } from 'lucide-react'
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { TYPE_BY_VALUE } from '../lib/constants'
|
||||
import Avatar from '../components/social/Avatar'
|
||||
@@ -14,7 +14,6 @@ import { progressView } from '../lib/rewatch'
|
||||
import type { Tab } from '../components/BottomNav'
|
||||
import { EmptyState, LinkArrow, PageHeader, SectionTitle, StatTile } from '../components/ui'
|
||||
import { CACHE_EVENT, isCaughtUp, loadAiring, needsCheck, refreshAiring, saveAiring, trackable } from '../lib/airing'
|
||||
import { addEpisodeNotifications } from '../lib/cloud/notifications'
|
||||
import { useOnResume } from '../lib/onResume'
|
||||
import { calendarEvents } from '../lib/releases'
|
||||
import { computeStats } from '../lib/stats'
|
||||
@@ -80,21 +79,6 @@ export default function HomePage({ onOpen, onAdd, onNavigate, onRoulette, onCale
|
||||
if (info.backdrop && !i.backdrop) patch.backdrop = info.backdrop
|
||||
return Object.keys(patch).length ? [{ id: i.id, patch }] : []
|
||||
})
|
||||
// Notifications : on envoie le dernier épisode sorti de chaque série encore en diffusion ;
|
||||
// le serveur retient le précédent et ne signale que ce qui est sorti depuis (le passé n'est pas « nouveau »).
|
||||
if (social.enabled) {
|
||||
const notices = trackable(items).flatMap((i) => {
|
||||
const info = next[i.id]
|
||||
if (!info || info.ended || info.aired < 1 || i.status === 'abandonne') return []
|
||||
const kind = i.status === 'termine' ? ('new_season' as const) : ('new_episode' as const)
|
||||
return [{ item_id: i.id, kind, episode: info.aired, count: Math.max(1, info.aired - i.episodesWatched) }]
|
||||
})
|
||||
void (async () => {
|
||||
let created = 0
|
||||
for (let k = 0; k < notices.length; k += 50) created += await addEpisodeNotifications(notices.slice(k, k + 50))
|
||||
if (created > 0) void social.refresh()
|
||||
})()
|
||||
}
|
||||
if (patches.length) return patchMany(patches)
|
||||
})
|
||||
.catch(() => {})
|
||||
@@ -102,7 +86,7 @@ export default function HomePage({ onOpen, onAdd, onNavigate, onRoulette, onCale
|
||||
airingRunning.current = false
|
||||
setCheckingAiring(false)
|
||||
})
|
||||
}, [patchMany, social])
|
||||
}, [patchMany])
|
||||
useEffect(() => {
|
||||
if (loading || airingStarted.current) return
|
||||
airingStarted.current = true
|
||||
@@ -171,18 +155,6 @@ export default function HomePage({ onOpen, onAdd, onNavigate, onRoulette, onCale
|
||||
<span className="absolute -end-1 -top-1 grid min-w-5 place-items-center rounded-full bg-accent-fill px-1 text-[10px] font-bold text-on-accent">{soon}</span>
|
||||
)}
|
||||
</button>
|
||||
{social.enabled && (
|
||||
<button
|
||||
onClick={social.openNotifications}
|
||||
className="relative grid size-11 shrink-0 place-items-center rounded-full border border-line text-ink-2 transition-colors active:bg-surface-2"
|
||||
aria-label={social.unread > 0 ? t('home.notificationsN', { count: social.unread }) : t('home.notifications')}
|
||||
>
|
||||
<Bell size={20} />
|
||||
{social.unread > 0 && (
|
||||
<span className="absolute -end-1 -top-1 grid min-w-5 place-items-center rounded-full bg-accent-fill px-1 text-[10px] font-bold text-on-accent">{social.unread}</span>
|
||||
)}
|
||||
</button>
|
||||
)}
|
||||
{social.enabled && (
|
||||
<button onClick={() => (social.me ? social.openProfile(social.me.username) : social.openSearch())} className="relative shrink-0 rounded-full" aria-label={t('social.myProfile')}>
|
||||
<Avatar url={social.me?.avatarUrl} name={social.me?.displayName ?? '?'} size={44} />
|
||||
|
||||
@@ -3,7 +3,6 @@ import { LanguageSelect } from '../i18n/react'
|
||||
import { Check, Download, ExternalLink, Eye, EyeOff, HardDrive, Import, ShieldCheck, Smartphone, Trash2, Upload, UserX } from 'lucide-react'
|
||||
import { useEffect, useRef, useState, type ReactNode } from 'react'
|
||||
import AccountSection from '../components/AccountSection'
|
||||
import PushToggle from '../components/PushToggle'
|
||||
import ConfirmDialog from '../components/ConfirmDialog'
|
||||
import ImportWizard from '../components/ImportWizard'
|
||||
import { PageHeader, SectionTitle } from '../components/ui'
|
||||
@@ -14,7 +13,6 @@ import { ALL_TOP_CATEGORIES, TOP_CATEGORIES } from '../lib/constants'
|
||||
import { isHexColor, THEME_MODES, THEME_PRESETS } from '../lib/theme'
|
||||
import { detectPlatform, useInstallPrompt } from '../lib/pwa'
|
||||
import { isAdmin } from '../lib/cloud/admin'
|
||||
import type { NotifPrefs } from '../types'
|
||||
import { cx } from '../lib/utils'
|
||||
import { useEscape } from '../lib/escape'
|
||||
import { useBackToClose } from '../lib/backNav'
|
||||
@@ -25,15 +23,6 @@ import { alertsSummary, useAdminAlerts } from '../components/moderation/useAdmin
|
||||
|
||||
type Message = { kind: 'ok' | 'error'; text: string }
|
||||
|
||||
const NOTIF_PREFS: { key: keyof NotifPrefs; readonly label: () => string }[] = [
|
||||
{ key: 'episodes', label: () => t('settings.notifEpisodes') },
|
||||
{ key: 'follows', label: () => t('settings.notifFollows') },
|
||||
{ key: 'accepted', label: () => t('settings.notifAccepted') },
|
||||
{ key: 'reactions', label: () => t('settings.notifReactions') },
|
||||
{ key: 'comments', label: () => t('settings.notifComments') },
|
||||
{ key: 'lists', label: () => t('settings.notifLists') },
|
||||
]
|
||||
|
||||
function Row({ icon, title, hint, onClick, danger }: { icon: ReactNode; title: string; hint?: string; onClick: () => void; danger?: boolean }) {
|
||||
return (
|
||||
<button onClick={onClick} className={cx('flex w-full items-center gap-3.5 px-4 py-4 text-start transition-colors active:bg-surface-2', danger && 'text-accent')}>
|
||||
@@ -324,33 +313,6 @@ export default function SettingsPage({ onOpenAdmin }: { onOpenAdmin: () => void
|
||||
</div>
|
||||
)}
|
||||
|
||||
{account && (
|
||||
<>
|
||||
<SectionTitle>{t('settings.notifs')}</SectionTitle>
|
||||
<p className="mb-3 text-xs text-ink-3">{t('settings.notifsHint')}</p>
|
||||
<PushToggle />
|
||||
<div className="card divide-y divide-line overflow-hidden">
|
||||
{NOTIF_PREFS.map(({ key, label }) => {
|
||||
const on = settings.notifPrefs?.[key] !== false
|
||||
return (
|
||||
<button
|
||||
key={key}
|
||||
type="button"
|
||||
role="switch"
|
||||
aria-checked={on}
|
||||
onClick={() => updateSettings({ notifPrefs: { ...settings.notifPrefs, [key]: !on } })}
|
||||
className="flex w-full items-center gap-3.5 px-4 py-3.5 text-start"
|
||||
>
|
||||
<span className="flex-1 text-sm font-medium">{label()}</span>
|
||||
<span className={cx('relative h-6 w-11 shrink-0 rounded-full transition-colors', on ? 'bg-accent-fill' : 'border border-line-strong bg-surface-2')}>
|
||||
<span className={cx('absolute top-0.5 size-5 rounded-full bg-ink transition-all', on ? 'start-[22px] bg-on-accent' : 'start-0.5')} />
|
||||
</span>
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
<SectionTitle>{t('settings.databases')}</SectionTitle>
|
||||
<div className="card space-y-4 p-4">
|
||||
|
||||
Reference in new issue
Block a user