Fix - bunch of branding and licensing issue
This commit is contained in:
@@ -167,6 +167,47 @@ const App = (message, props) => {
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (userdata &&
|
||||
userdata?.org_status?.includes("integration_partner") &&
|
||||
userdata?.active_org?.image) {
|
||||
|
||||
const existingLinks = document.querySelectorAll("link[rel*='icon']");
|
||||
existingLinks.forEach(link => link.parentNode.removeChild(link));
|
||||
const newLink = document.createElement('link');
|
||||
newLink.rel = 'icon';
|
||||
newLink.type = 'image/x-icon';
|
||||
try {
|
||||
if (typeof userdata.active_org.image === 'string') {
|
||||
if (userdata.active_org.image.startsWith('data:')) {
|
||||
newLink.href = userdata.active_org.image;
|
||||
} else if (userdata.active_org.image.startsWith('/')) {
|
||||
newLink.href = userdata.active_org.image;
|
||||
} else {
|
||||
let mimeType = 'image/png';
|
||||
newLink.href = `data:${mimeType};base64,${userdata.active_org.image}`;
|
||||
}
|
||||
} else {
|
||||
console.error("Image data is not in expected format:", userdata.active_org.image);
|
||||
return;
|
||||
}
|
||||
|
||||
// Add the new favicon link to head
|
||||
document.head.appendChild(newLink);
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.style.display = 'none';
|
||||
document.body.appendChild(iframe);
|
||||
iframe.contentDocument.write('<link rel="icon" href="' + newLink.href + '">');
|
||||
setTimeout(() => {
|
||||
document.body.removeChild(iframe);
|
||||
}, 100);
|
||||
|
||||
} catch (error) {
|
||||
console.error("Error updating favicon:", error);
|
||||
}
|
||||
}
|
||||
}, [userdata]);
|
||||
|
||||
const checkLogin = () => {
|
||||
var baseurl = globalUrl;
|
||||
fetch(`${globalUrl}/api/v1/getinfo`, {
|
||||
|
||||
Reference in New Issue
Block a user