Create codemod for updating Toast calls to v2 (#10045)
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import {useAgent, useSession} from '#/state/session'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import * as Toast from '#/components/Toast'
|
||||
|
||||
export const RQKEY_getActivitySubscriptions = ['activity-subscriptions']
|
||||
export const RQKEY_getNotificationDeclaration = ['notification-declaration']
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
|
||||
import {logger} from '#/logger'
|
||||
import {useAgent} from '#/state/session'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import * as Toast from '#/components/Toast'
|
||||
|
||||
const RQKEY_ROOT = 'notification-settings'
|
||||
const RQKEY = [RQKEY_ROOT]
|
||||
@@ -46,7 +46,9 @@ export function useNotificationSettingsUpdateMutation() {
|
||||
onError: e => {
|
||||
logger.error('Could not update notification settings', {message: e})
|
||||
queryClient.invalidateQueries({queryKey: RQKEY})
|
||||
Toast.show(t`Could not update notification settings`, 'xmark')
|
||||
Toast.show(t`Could not update notification settings`, {
|
||||
type: 'error',
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {logger} from '#/logger'
|
||||
import {RQKEY as FEED_RQKEY} from '#/state/queries/post-feed'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import * as Toast from '#/components/Toast'
|
||||
import {updatePostShadow} from '../cache/post-shadow'
|
||||
import {useAgent, useSession} from '../session'
|
||||
import {useProfileUpdateMutation} from './profile'
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
RQKEY_LINK_ROOT,
|
||||
} from '#/state/queries/resolve-link'
|
||||
import {type EmojiPickerPosition} from '#/view/com/composer/text-input/web/EmojiPicker'
|
||||
import * as Toast from '#/view/com/util/Toast'
|
||||
import * as Toast from '#/components/Toast'
|
||||
|
||||
export interface ComposerOptsPostRef {
|
||||
uri: string
|
||||
@@ -104,10 +104,9 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
||||
author.viewer?.blockingByList),
|
||||
)
|
||||
if (isBlocked) {
|
||||
Toast.show(
|
||||
_(msg`Cannot interact with a blocked user`),
|
||||
'exclamation-circle',
|
||||
)
|
||||
Toast.show(_(msg`Cannot interact with a blocked user`), {
|
||||
type: 'warning',
|
||||
})
|
||||
} else {
|
||||
setState(prevOpts => {
|
||||
if (prevOpts) {
|
||||
|
||||
Reference in New Issue
Block a user