Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: reduce webapp icon displayed on browser tab flickering when page is loading (#9212)

Hash Brown1c1e008dcf97
diff --git a/web/app/(shareLayout)/layout.tsx b/web/app/(shareLayout)/layout.tsx
index 9c4632cd450..259af2bc2dc 100644
--- a/web/app/(shareLayout)/layout.tsx
+++ b/web/app/(shareLayout)/layout.tsx
@@ -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 }) => {
diff --git a/web/hooks/use-app-favicon.ts b/web/hooks/use-app-favicon.ts
index 1ff743928fa..e8a01733712 100644
--- a/web/hooks/use-app-favicon.ts
+++ b/web/hooks/use-app-favicon.ts
@@ -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