mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 23:57:12 +01:00
Disable website select for saved report. Fix delete website routing
This commit is contained in:
parent
91e3dff7f5
commit
5ae04291af
6 changed files with 31 additions and 22 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { Button, Modal, ModalTrigger, ActionForm, useToasts } from 'react-basics';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useMessages, useModified } from 'components/hooks';
|
||||
import { useMessages, useModified, useTeamUrl } from 'components/hooks';
|
||||
import WebsiteDeleteForm from './WebsiteDeleteForm';
|
||||
import WebsiteResetForm from './WebsiteResetForm';
|
||||
|
||||
|
|
@ -9,6 +9,7 @@ export function WebsiteData({ websiteId, onSave }: { websiteId: string; onSave?:
|
|||
const router = useRouter();
|
||||
const { showToast } = useToasts();
|
||||
const { touch } = useModified();
|
||||
const { teamId, renderTeamUrl } = useTeamUrl();
|
||||
|
||||
const handleReset = async () => {
|
||||
showToast({ message: formatMessage(messages.saved), variant: 'success' });
|
||||
|
|
@ -16,8 +17,13 @@ export function WebsiteData({ websiteId, onSave }: { websiteId: string; onSave?:
|
|||
};
|
||||
|
||||
const handleDelete = async () => {
|
||||
touch('websites');
|
||||
router.push('/settings/websites');
|
||||
if (teamId) {
|
||||
touch('teams:websites');
|
||||
router.push(renderTeamUrl('/settings/websites'));
|
||||
} else {
|
||||
touch('websites');
|
||||
router.push('/settings/websites');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue