mirror of
https://github.com/umami-software/umami.git
synced 2026-02-23 22:15:35 +01:00
Convert useModified into a real hook.
This commit is contained in:
parent
a426c242cb
commit
91e3dff7f5
24 changed files with 63 additions and 48 deletions
|
|
@ -11,9 +11,8 @@ import {
|
|||
} from 'react-basics';
|
||||
import { useContext, useState } from 'react';
|
||||
import { getRandomChars } from 'next-basics';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
import { useApi, useMessages, useModified } from 'components/hooks';
|
||||
import { WebsiteContext } from 'app/(main)/websites/[websiteId]/WebsiteProvider';
|
||||
import { touch } from 'store/modified';
|
||||
|
||||
const generateId = () => getRandomChars(16);
|
||||
|
||||
|
|
@ -33,6 +32,7 @@ export function ShareUrl({
|
|||
const { mutate, error, isPending } = useMutation({
|
||||
mutationFn: (data: any) => post(`/websites/${website.id}`, data),
|
||||
});
|
||||
const { touch } = useModified();
|
||||
|
||||
const url = `${hostUrl || process.env.hostUrl || window?.location.origin}${
|
||||
process.env.basePath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue