diff options
author | Eric Bailey <git@esb.lol> | 2024-08-01 10:29:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-01 10:29:27 -0500 |
commit | b0e130a4d85f2056bddcbf210aa7ea4068d41686 (patch) | |
tree | 8ddff0edd9a564c952daccb58c79d092ef35ba25 /src/state/queries/preferences/index.ts | |
parent | d2e88cc623b2df5fe40280618fe9598334df8241 (diff) | |
download | voidsky-b0e130a4d85f2056bddcbf210aa7ea4068d41686.tar.zst |
Update muted words dialog with `expiresAt` and `actorTarget` (#4801)
* WIP not working dropdown * Update MutedWords dialog * Add i18n formatDistance * Comments * Handle text wrapping * Update label copy Co-authored-by: Hailey <me@haileyok.com> * Fix alignment * Improve translation output * Revert toggle changes * Better types for useFormatDistance * Tweaks * Integrate new sdk version into TagMenu * Use ampersand Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com> * Bump SDK --------- Co-authored-by: Hailey <me@haileyok.com> Co-authored-by: surfdude29 <149612116+surfdude29@users.noreply.github.com>
Diffstat (limited to 'src/state/queries/preferences/index.ts')
-rw-r--r-- | src/state/queries/preferences/index.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/state/queries/preferences/index.ts b/src/state/queries/preferences/index.ts index 9bb57fcaf..6991f8647 100644 --- a/src/state/queries/preferences/index.ts +++ b/src/state/queries/preferences/index.ts @@ -343,6 +343,21 @@ export function useRemoveMutedWordMutation() { }) } +export function useRemoveMutedWordsMutation() { + const queryClient = useQueryClient() + const agent = useAgent() + + return useMutation({ + mutationFn: async (mutedWords: AppBskyActorDefs.MutedWord[]) => { + await agent.removeMutedWords(mutedWords) + // triggers a refetch + await queryClient.invalidateQueries({ + queryKey: preferencesQueryKey, + }) + }, + }) +} + export function useQueueNudgesMutation() { const queryClient = useQueryClient() const agent = useAgent() |