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
@@ -1,6 +1,5 @@
|
||||
import { createContext, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from 'react'
|
||||
import { getFollowRequests, getMyProfile, type Profile, type ProfileCard } from '../../lib/cloud/social'
|
||||
import { unreadCount } from '../../lib/cloud/notifications'
|
||||
import { useMedia } from '../../store'
|
||||
import type { MediaItem } from '../../types'
|
||||
import EditProfile from './EditProfile'
|
||||
@@ -9,7 +8,6 @@ import ItemPeek, { type PeekOwner } from './ItemPeek'
|
||||
import PeopleSearch from './PeopleSearch'
|
||||
import ProfileView from './ProfileView'
|
||||
import TitleReviews from './TitleReviews'
|
||||
import Notifications from './Notifications'
|
||||
import { useOnResume } from '../../lib/onResume'
|
||||
import WelcomeProfile, { RANDOM_USERNAME } from './WelcomeProfile'
|
||||
import CommentsSheet from './CommentsSheet'
|
||||
@@ -30,10 +28,6 @@ interface SocialApi {
|
||||
openFollowList: (profile: Profile, kind: 'followers' | 'following') => void
|
||||
/** Tous les avis sur un titre (amis / autres) */
|
||||
openReviews: (externalId: string, title: string) => void
|
||||
/** Panneau des notifications */
|
||||
openNotifications: () => void
|
||||
/** Notifications non lues */
|
||||
unread: number
|
||||
peek: (item: MediaItem, owner?: PeekOwner) => void
|
||||
/** Ouvre la fiche si elle est à moi, sinon l'aperçu */
|
||||
openItem: (item: MediaItem, owner?: PeekOwner) => void
|
||||
@@ -60,8 +54,6 @@ const SocialContext = createContext<SocialApi>({
|
||||
openEdit: () => {},
|
||||
openFollowList: () => {},
|
||||
openReviews: () => {},
|
||||
openNotifications: () => {},
|
||||
unread: 0,
|
||||
peek: () => {},
|
||||
openItem: () => {},
|
||||
openComments: () => {},
|
||||
@@ -80,7 +72,6 @@ type Overlay =
|
||||
| { kind: 'edit' }
|
||||
| { kind: 'follows'; profile: Profile; list: 'followers' | 'following' }
|
||||
| { kind: 'reviews'; externalId: string; title: string }
|
||||
| { kind: 'notifications' }
|
||||
| { kind: 'comments'; authorId: string; itemId: string; title: string }
|
||||
| { kind: 'sharedList'; id: string }
|
||||
| { kind: 'invite'; listId: string; listName: string }
|
||||
@@ -100,7 +91,6 @@ export function SocialProvider({
|
||||
const enabled = !!account
|
||||
const [me, setMe] = useState<Profile | null>(null)
|
||||
const [requests, setRequests] = useState<ProfileCard[]>([])
|
||||
const [unread, setUnread] = useState(0)
|
||||
const [stack, setStack] = useState<Overlay[]>([])
|
||||
const [peeked, setPeeked] = useState<{ item: MediaItem; owner?: PeekOwner }>()
|
||||
const [sharedTick, setSharedTick] = useState(0)
|
||||
@@ -125,10 +115,9 @@ export function SocialProvider({
|
||||
const refresh = useCallback(async () => {
|
||||
if (!enabled || !navigator.onLine) return
|
||||
try {
|
||||
const [p, r, u] = await Promise.all([getMyProfile(), getFollowRequests(), unreadCount()])
|
||||
const [p, r] = await Promise.all([getMyProfile(), getFollowRequests()])
|
||||
setMe(p)
|
||||
setRequests(r)
|
||||
setUnread(u)
|
||||
} catch {
|
||||
/* hors-ligne / serveur pas encore à jour : le reste de l'app fonctionne */
|
||||
}
|
||||
@@ -202,12 +191,6 @@ export function SocialProvider({
|
||||
openEdit: () => push({ kind: 'edit' }),
|
||||
openFollowList: (profile, list) => push({ kind: 'follows', profile, list }),
|
||||
openReviews: (externalId, title) => push({ kind: 'reviews', externalId, title }),
|
||||
openNotifications: () => {
|
||||
// La liste se marque lue elle-même, après chargement (sinon les « non lu » n'étaient jamais visibles)
|
||||
setUnread(0)
|
||||
push({ kind: 'notifications' })
|
||||
},
|
||||
unread,
|
||||
peek: (item, owner) => setPeeked({ item, owner }),
|
||||
openItem,
|
||||
openComments: (authorId, itemId, title) => push({ kind: 'comments', authorId, itemId, title }),
|
||||
@@ -217,7 +200,7 @@ export function SocialProvider({
|
||||
sharedTick,
|
||||
bumpShared,
|
||||
}),
|
||||
[enabled, me, requests, unread, refresh, push, openItem, openTitle, sharedTick, bumpShared],
|
||||
[enabled, me, requests, refresh, push, openItem, openTitle, sharedTick, bumpShared],
|
||||
)
|
||||
|
||||
return (
|
||||
@@ -239,30 +222,8 @@ export function SocialProvider({
|
||||
<CommentsSheet key={k} authorId={o.authorId} itemId={o.itemId} title={o.title} onClose={pop} />
|
||||
) : o.kind === 'sharedList' ? (
|
||||
<SharedListSheet key={k} id={o.id} onClose={pop} />
|
||||
) : o.kind === 'invite' ? (
|
||||
<InvitePeople key={k} listId={o.listId} listName={o.listName} onClose={pop} />
|
||||
) : (
|
||||
<Notifications
|
||||
key={k}
|
||||
onClose={pop}
|
||||
onOpenProfile={(u) => push({ kind: 'profile', username: u })}
|
||||
onOpenItem={(id) => {
|
||||
const it = items.find((i) => i.id === id)
|
||||
if (it) {
|
||||
pop()
|
||||
onOpenOwnItem(it)
|
||||
}
|
||||
}}
|
||||
onOpenComments={(itemId, title) => {
|
||||
if (!me) return
|
||||
pop()
|
||||
push({ kind: 'comments', authorId: me.id, itemId, title })
|
||||
}}
|
||||
onOpenSharedList={(id) => {
|
||||
pop()
|
||||
push({ kind: 'sharedList', id })
|
||||
}}
|
||||
/>
|
||||
<InvitePeople key={k} listId={o.listId} listName={o.listName} onClose={pop} />
|
||||
),
|
||||
)}
|
||||
{children}
|
||||
|
||||
Reference in new issue
Block a user