Skip to content

Commit

Permalink
fix: stop broadcasting react-query cache changes (#11417)
Browse files Browse the repository at this point in the history
  • Loading branch information
swkatmask authored and guanbinrui committed Feb 27, 2024
1 parent b4b3207 commit f7b306f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/mask/shared-ui/initialization/react-query.ts
@@ -1,9 +1,5 @@
import { queryClient } from '@masknet/shared-base-ui'
import { broadcastQueryClient } from '../utils/broadcastQueryClient.js'
import { setInitData } from '../utils/persistOptions.js'

broadcastQueryClient({ queryClient })

browser.storage.local.get('react-query').then(({ 'react-query': data }) => {
setInitData('react-query', data)
})
4 changes: 4 additions & 0 deletions packages/mask/shared-ui/utils/broadcastQueryClient.ts
Expand Up @@ -6,6 +6,10 @@ interface BroadcastQueryClientOptions {
queryClient: QueryClient
}

/**
* @deprecated
* Broadcasting cache changes might decrease performance, freezes web page sometimes
*/
export function broadcastQueryClient({ queryClient }: BroadcastQueryClientOptions) {
let transaction = false
const tx = (cb: () => void) => {
Expand Down

0 comments on commit f7b306f

Please sign in to comment.