Fixed the favicon renderer not rendering the icon on the first connection

canary
WolverinDEV 2020-09-28 10:50:40 +02:00 committed by WolverinDEV
parent 6781cb4e96
commit 5547a7b865
1 changed files with 6 additions and 2 deletions

View File

@ -61,7 +61,10 @@ function initializeFaviconController(events: Registry<FaviconEvents>) {
const setCurrentHandler = (handler: ConnectionHandler) => {
finalizeCurrentHandler();
initializeCurrentHandler(handler);
if(handler) {
initializeCurrentHandler(handler);
}
currentHandler = handler;
sendFavicon();
}
@ -85,6 +88,7 @@ function initializeFaviconController(events: Registry<FaviconEvents>) {
events.fire_async("notify_icon", { icon: icon })
};
setCurrentHandler(server_connections.active_connection());
events.on("query_icon", () => sendFavicon());
}
@ -108,7 +112,7 @@ const FaviconRenderer = (props: { events: Registry<FaviconEvents> }) => {
if(!favicon) {
return <DefaultFaviconRenderer key={"default"} />;
} else {
return <ClientIconFaviconRenderer icon={favicon} key={"icon"} />;
return <ClientIconFaviconRenderer icon={favicon} key={"icon-" + favicon} />;
}
}