Skip to content

Commit

Permalink
fix: reduce webapp icon displayed on browser tab flickering when page…
Browse files Browse the repository at this point in the history
… is loading (#9212)
  • Loading branch information
xuzuodong authored Oct 11, 2024
1 parent fe41e8b commit 1c1e008
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions web/app/(shareLayout)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react'
import type { FC } from 'react'
import type { Metadata } from 'next'
import GA, { GaType } from '@/app/components/base/ga'

export const metadata: Metadata = {
icons: 'data:,', // prevent browser from using default favicon
}

const Layout: FC<{
children: React.ReactNode
}> = ({ children }) => {
Expand Down
2 changes: 1 addition & 1 deletion web/hooks/use-app-favicon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function useAppFavicon(options: UseAppFaviconOptions) {
} = options

useAsyncEffect(async () => {
if (!enable)
if (!enable || (icon_type === 'image' && !icon_url) || (icon_type === 'emoji' && !icon))
return

const isValidImageIcon = icon_type === 'image' && icon_url
Expand Down

0 comments on commit 1c1e008

Please sign in to comment.