mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Converted variables to be runtime.
This commit is contained in:
parent
b6862de2be
commit
5b6292dd11
11 changed files with 46 additions and 36 deletions
|
|
@ -9,11 +9,11 @@ function getHostName(url: string) {
|
|||
export function Favicon({ domain, ...props }) {
|
||||
const config = useConfig();
|
||||
|
||||
if (process.env.privateMode) {
|
||||
if (config?.privateMode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const url = config?.faviconURL || FAVICON_URL;
|
||||
const url = config?.faviconUrl || FAVICON_URL;
|
||||
const hostName = domain ? getHostName(domain) : null;
|
||||
const domainName = GROUPED_DOMAINS[hostName]?.domain || hostName;
|
||||
const src = hostName ? url.replace(/\{\{\s*domain\s*}}/, domainName) : null;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { useEffect } from 'react';
|
||||
import useStore, { setConfig } from '@/store/app';
|
||||
import { getConfig } from '@/app/actions/getConfig';
|
||||
import { getConfig, Config } from '@/app/actions/getConfig';
|
||||
|
||||
export function useConfig() {
|
||||
export function useConfig(): Config {
|
||||
const { config } = useStore();
|
||||
|
||||
async function loadConfig() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue