diff --git a/eslint-suppressions.json b/eslint-suppressions.json index c3bbd462ca..06ac176613 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -946,14 +946,6 @@ "count": 1 } }, - "src/lib/hooks/useNotificationHandler.ts": { - "@typescript-eslint/no-floating-promises": { - "count": 16 - }, - "@typescript-eslint/require-await": { - "count": 1 - } - }, "src/lib/hooks/useOTAUpdates.ts": { "@typescript-eslint/no-explicit-any": { "count": 2 @@ -2183,14 +2175,6 @@ "count": 2 } }, - "src/view/com/modals/Modal.tsx": { - "@typescript-eslint/no-misused-promises": { - "count": 1 - }, - "@typescript-eslint/require-await": { - "count": 1 - } - }, "src/view/com/notifications/NotificationFeed.tsx": { "@typescript-eslint/no-explicit-any": { "count": 2 diff --git a/package.json b/package.json index 3981e9016f..bb0c86960a 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "update-actions": "pnpm dlx actions-up --min-age 7" }, "dependencies": { - "@atproto/api": "0.20.15", + "@atproto/api": "0.20.20", "@atproto/syntax": "0.6.1", "@bitdrift/react-native": "^0.6.8", "@braintree/sanitize-url": "^6.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7be643fae5..d1ff05dc50 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -241,8 +241,8 @@ importers: .: dependencies: '@atproto/api': - specifier: 0.20.15 - version: 0.20.15 + specifier: 0.20.20 + version: 0.20.20 '@atproto/syntax': specifier: 0.6.1 version: 0.6.1 @@ -876,32 +876,36 @@ packages: graphql: optional: true - '@atproto/api@0.20.15': - resolution: {integrity: sha512-b9TuVNY9iWIaRXAeKegNCqRsK9tSpB68DE/j/ytVTxEMK+/m43B0DycJND9tnhRiNIY+i7MhwLqNHPak9YaDJg==} + '@atproto/api@0.20.20': + resolution: {integrity: sha512-+yqxLCvMu36xRxwc8/x0mhptZBC+/cbfPwdzeOtlBUeVi4ZB/5RWg2L4lWWdhBSiQBZw0AgaPg/2zsx4lDFgjg==} engines: {node: '>=22'} - '@atproto/common-web@0.5.0': - resolution: {integrity: sha512-ReWnkuZdDU/74/I47gaI26uxQjHmpq4edp41NnZZQ5vIIKGb7Ei6pZHzDTUD9JURo109SKrPx9RMP2IQm0fOKA==} + '@atproto/common-web@0.5.1': + resolution: {integrity: sha512-nru02gLyzjMQn4ZFgms9ry3kIAKwMaCAvjeFhB9mU6h1ABiSho7aRDbGvnU50CC88TROXuZlgRiEkBjnuiHEtA==} engines: {node: '>=22'} - '@atproto/lex-data@0.1.1': - resolution: {integrity: sha512-/xza8nU/YhtzhETnHL3QKKofaJ28/0NCzhT7LaYoUkm8EgypWp5ykEtmW52yLhQM2JF6fVa25g1soQmNTGqtSg==} + '@atproto/lex-data@0.1.2': + resolution: {integrity: sha512-NZ4iZvNaqTM6pz+9VRDyEjtozrrf2EDHySNi3Xa8PCzS8gRMCvsnnsvM7r264v4eSqNIDhBB8fr9hfWCHMspXg==} engines: {node: '>=22'} - '@atproto/lex-json@0.1.0': - resolution: {integrity: sha512-oWUrRMwFyWpmi/5k1Se3xBTbP06XdxBS5iFuUz9LmqItaPXwrWRD87a9ldPvINQ/A2/mn7J6/qug8sDVlhD+vQ==} + '@atproto/lex-json@0.1.1': + resolution: {integrity: sha512-FC/NsKHm8TDzWikvf/268T3mMAh6+f31yfCApWC3SvrhWc9c06cSYPp7qzpXcdV0OdB+I5dqHScuTB5OC7HrXg==} engines: {node: '>=22'} - '@atproto/lexicon@0.7.1': - resolution: {integrity: sha512-voNfNED5KUxn3vpo7N5DMRblBDfWf7kSfdKhJFC1RrLCxg38YbBzzURNVQJ32bp13Oot8kYfyXBWxTgtKLvw8w==} + '@atproto/lexicon@0.7.2': + resolution: {integrity: sha512-LVZcTr5+9Qh0okZnNmfRiIDPfbL/6rRxf4goiQxPxwDzaeUDhn4M209i1drmiitbCO1qRLJA2hHF54yNA75Cig==} engines: {node: '>=22'} '@atproto/syntax@0.6.1': resolution: {integrity: sha512-kA4dQDoMPpWCH8N0Q4KoSq024u5MkVfDVa8DdhyLjGA72z/khbOf1jXKPv7NIL2oEc9aj7geKELdvqyf4ogopA==} engines: {node: '>=22'} - '@atproto/xrpc@0.8.0': - resolution: {integrity: sha512-NJy02bIKrWlE2NQkRV1kT0Cj0ixbuxlF/MejBdo4cPWAa9v3oZexvAcjjb0zaOYeABkaU14iyIhvn2G4e/oLpw==} + '@atproto/syntax@0.6.2': + resolution: {integrity: sha512-h3njTNFl/jv5kTbDqfamQGOJfGbulqLDuAiLbasKwVdBhFyQanpRLa6vE2WqTwv1XEFWLYNMH0KCVsYwT2+aww==} + engines: {node: '>=22'} + + '@atproto/xrpc@0.8.1': + resolution: {integrity: sha512-sKopRG3an6LN6NfHnRNIEX1fBx3CRtxbNFWQxyse2f86wMcTuXM+/+olN4lVXgFQgv4AWvKTxRXWyuIF2G4YxQ==} engines: {node: '>=22'} '@babel/code-frame@7.10.4': @@ -9472,40 +9476,40 @@ snapshots: '@0no-co/graphql.web@1.2.0': {} - '@atproto/api@0.20.15': + '@atproto/api@0.20.20': dependencies: - '@atproto/common-web': 0.5.0 - '@atproto/lexicon': 0.7.1 - '@atproto/syntax': 0.6.1 - '@atproto/xrpc': 0.8.0 + '@atproto/common-web': 0.5.1 + '@atproto/lexicon': 0.7.2 + '@atproto/syntax': 0.6.2 + '@atproto/xrpc': 0.8.1 await-lock: 3.0.0 multiformats: 13.4.2 tlds: 1.261.0 zod: 3.25.76 - '@atproto/common-web@0.5.0': + '@atproto/common-web@0.5.1': dependencies: - '@atproto/lex-data': 0.1.1 - '@atproto/lex-json': 0.1.0 - '@atproto/syntax': 0.6.1 + '@atproto/lex-data': 0.1.2 + '@atproto/lex-json': 0.1.1 + '@atproto/syntax': 0.6.2 zod: 3.25.76 - '@atproto/lex-data@0.1.1': + '@atproto/lex-data@0.1.2': dependencies: multiformats: 13.4.2 tslib: 2.8.1 uint8arrays: 5.1.1 unicode-segmenter: 0.14.5 - '@atproto/lex-json@0.1.0': + '@atproto/lex-json@0.1.1': dependencies: - '@atproto/lex-data': 0.1.1 + '@atproto/lex-data': 0.1.2 tslib: 2.8.1 - '@atproto/lexicon@0.7.1': + '@atproto/lexicon@0.7.2': dependencies: - '@atproto/common-web': 0.5.0 - '@atproto/syntax': 0.6.1 + '@atproto/common-web': 0.5.1 + '@atproto/syntax': 0.6.2 multiformats: 13.4.2 zod: 3.25.76 @@ -9514,9 +9518,14 @@ snapshots: iso-datestring-validator: 2.2.2 tslib: 2.8.1 - '@atproto/xrpc@0.8.0': + '@atproto/syntax@0.6.2': dependencies: - '@atproto/lexicon': 0.7.1 + iso-datestring-validator: 2.2.2 + tslib: 2.8.1 + + '@atproto/xrpc@0.8.1': + dependencies: + '@atproto/lexicon': 0.7.2 zod: 3.25.76 '@babel/code-frame@7.10.4': diff --git a/src/components/dialogs/NotificationSettingsDialog.tsx b/src/components/dialogs/NotificationSettingsDialog.tsx index c62f6a7d98..bed3106c08 100644 --- a/src/components/dialogs/NotificationSettingsDialog.tsx +++ b/src/components/dialogs/NotificationSettingsDialog.tsx @@ -1,8 +1,12 @@ import {View} from 'react-native' -import {type AppBskyNotificationDefs} from '@atproto/api' import {Trans, useLingui} from '@lingui/react/macro' -import {useNotificationSettingsQuery} from '#/state/queries/notifications/settings' +import { + isChatPreferenceName, + type NotificationSettingsPreferenceName, + useChatNotificationSettingsQuery, + useNotificationSettingsQuery, +} from '#/state/queries/notifications/settings' import * as SettingsList from '#/screens/Settings/components/SettingsList' import {PreferenceControls} from '#/screens/Settings/NotificationSettings/components/PreferenceControls' import {atoms as a, useTheme, web} from '#/alf' @@ -15,8 +19,8 @@ import {IS_NATIVE} from '#/env' type NotificationSettingsDialogProps = { control: Dialog.DialogControlProps - name: Exclude - syncOthers?: Exclude[] + name: NotificationSettingsPreferenceName + syncOthers?: NotificationSettingsPreferenceName[] icon: React.ComponentType titleText: React.ReactNode subtitleText: React.ReactNode @@ -55,7 +59,11 @@ function NotificationSettingsDialogInner({ }: Omit) { const t = useTheme() const {t: l} = useLingui() - const {data: preferences, isError} = useNotificationSettingsQuery() + const isChat = isChatPreferenceName(name) + const appQuery = useNotificationSettingsQuery({enabled: !isChat}) + const chatQuery = useChatNotificationSettingsQuery({enabled: isChat}) + const isError = isChat ? chatQuery.isError : appQuery.isError + const preference = isChat ? chatQuery.data?.[name] : appQuery.data?.[name] return ( <> @@ -81,7 +89,7 @@ function NotificationSettingsDialogInner({ )} @@ -89,7 +97,7 @@ function NotificationSettingsDialogInner({ {IS_NATIVE && (