Updated Dash

This commit is contained in:
The-Yearly 2025-05-16 17:41:29 +05:30
parent 0a8d80196f
commit ac7ed553ab
3 changed files with 3 additions and 8 deletions

View file

@ -55,12 +55,7 @@ export function DashboardEdit({ teamId }: { teamId: string }) {
const orderedWebsites = [...ordered]; const orderedWebsites = [...ordered];
const [removed] = orderedWebsites.splice(source.index, 1); const [removed] = orderedWebsites.splice(source.index, 1);
orderedWebsites.splice(destination.index, 0, removed); orderedWebsites.splice(destination.index, 0, removed);
setOrder(orderedWebsites.filter(website => website?.id).map(website => website.id));
setOrder(
orderedWebsites
.map(website => website?.id)
.filter((id): id is string => typeof id === 'string'),
);
setEdited(true); setEdited(true);
} }
function handleActiveWebsites(id: string) { function handleActiveWebsites(id: string) {

View file

@ -49,7 +49,7 @@ export function DashboardPage() {
<> <>
{editing && <DashboardEdit teamId={teamId} />} {editing && <DashboardEdit teamId={teamId} />}
{!editing && {!editing &&
(websiteActive.length != 0 ? ( (websiteActive.length !== 0 ? (
<> <>
<WebsiteChartList <WebsiteChartList
websites={result?.data as any} websites={result?.data as any}

View file

@ -390,7 +390,7 @@ export const messages = defineMessages({
}, },
noWebsitesToggled: { noWebsitesToggled: {
id: 'message.no-websites-toggled', id: 'message.no-websites-toggled',
defaultMessage: 'You have not toggled any websites', defaultMessage: 'You have not toggled any websites.',
}, },
noTeamWebsites: { noTeamWebsites: {