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;
|
const getKey = () => items.find(({ url }) => pathname === url)?.key;
|
||||||
|
|
||||||
if (cloudMode && pathname != '/settings/profile') {
|
if (cloudMode && pathname !== '/settings/profile') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +29,6 @@ export default function SettingsLayout({ children }) {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
settingsUrl: '/settings/websites',
|
settingsUrl: '/settings/websites',
|
||||||
hostUrl,
|
|
||||||
shareUrl: hostUrl,
|
shareUrl: hostUrl,
|
||||||
trackingCodeUrl: hostUrl,
|
trackingCodeUrl: hostUrl,
|
||||||
websitesUrl: `/websites`,
|
websitesUrl: `/websites`,
|
||||||
|
@ -51,7 +51,7 @@ export function WebsiteSettings({ websiteId, openExternal = false }) {
|
|||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
if (isLoading || !values) {
|
if (isLoading || !values) {
|
||||||
return <Loading />;
|
return <Loading position="page" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -17,15 +17,15 @@ import SettingsContext from '../../SettingsContext';
|
|||||||
const generateId = () => getRandomChars(16);
|
const generateId = () => getRandomChars(16);
|
||||||
|
|
||||||
export function ShareUrl({ websiteId, data, onSave }) {
|
export function ShareUrl({ websiteId, data, onSave }) {
|
||||||
|
const ref = useRef(null);
|
||||||
|
const { shareUrl, websitesUrl } = useContext(SettingsContext);
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
const { name, shareId } = data;
|
const { name, shareId } = data;
|
||||||
const [id, setId] = useState(shareId);
|
const [id, setId] = useState(shareId);
|
||||||
const { post, useMutation } = useApi();
|
const { post, useMutation } = useApi();
|
||||||
const { mutate, error } = useMutation({
|
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(
|
const url = useMemo(
|
||||||
() => `${shareUrl}${process.env.basePath}/share/${id}/${encodeURIComponent(name)}`,
|
() => `${shareUrl}${process.env.basePath}/share/${id}/${encodeURIComponent(name)}`,
|
||||||
[id, name],
|
[id, name],
|
||||||
|
Loading…
Reference in New Issue
Block a user