mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +01:00
Fixed share url.
This commit is contained in:
parent
4fca98d25d
commit
c8eb76c7af
@ -21,7 +21,7 @@ export default function SettingsLayout({ children }) {
|
||||
|
||||
const getKey = () => items.find(({ url }) => pathname === url)?.key;
|
||||
|
||||
if (cloudMode && pathname != '/settings/profile') {
|
||||
if (cloudMode && pathname !== '/settings/profile') {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -29,7 +29,6 @@ export default function SettingsLayout({ children }) {
|
||||
|
||||
const config = {
|
||||
settingsUrl: '/settings/websites',
|
||||
hostUrl,
|
||||
shareUrl: hostUrl,
|
||||
trackingCodeUrl: hostUrl,
|
||||
websitesUrl: `/websites`,
|
||||
|
@ -51,7 +51,7 @@ export function WebsiteSettings({ websiteId, openExternal = false }) {
|
||||
}, [data]);
|
||||
|
||||
if (isLoading || !values) {
|
||||
return <Loading />;
|
||||
return <Loading position="page" />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -17,15 +17,15 @@ import SettingsContext from '../../SettingsContext';
|
||||
const generateId = () => getRandomChars(16);
|
||||
|
||||
export function ShareUrl({ websiteId, data, onSave }) {
|
||||
const ref = useRef(null);
|
||||
const { shareUrl, websitesUrl } = useContext(SettingsContext);
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const { name, shareId } = data;
|
||||
const [id, setId] = useState(shareId);
|
||||
const { post, useMutation } = useApi();
|
||||
const { mutate, error } = useMutation({
|
||||
mutationFn: (data: any) => post(`/websites/${websiteId}`, data),
|
||||
mutationFn: (data: any) => post(`${websitesUrl}/${websiteId}`, data),
|
||||
});
|
||||
const ref = useRef(null);
|
||||
const { shareUrl } = useContext(SettingsContext);
|
||||
const url = useMemo(
|
||||
() => `${shareUrl}${process.env.basePath}/share/${id}/${encodeURIComponent(name)}`,
|
||||
[id, name],
|
||||
|
Loading…
Reference in New Issue
Block a user