Skip to content

Commit

Permalink
chore: fix ci problem and remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Sep 14, 2024
1 parent 6ce2f7f commit 95b51ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 48 deletions.
46 changes: 1 addition & 45 deletions src/client/components/WorkspaceSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const WorkspaceSwitcher: React.FC<WorkspaceSwitcherProps> = React.memo(
<CheckIcon
className={cn(
'ml-auto h-4 w-4',
currentWorkspace.id === workspace.id
currentWorkspace?.id === workspace.id
? 'opacity-100'
: 'opacity-0'
)}
Expand Down Expand Up @@ -259,50 +259,6 @@ export const WorkspaceSwitcher: React.FC<WorkspaceSwitcherProps> = React.memo(
</DialogContent>
</Dialog>
);

// return (
// <Select value={userInfo.currentWorkspace.id}>
// <SelectTrigger
// className={cn(
// 'flex items-center gap-2 [&>span]:line-clamp-1 [&>span]:flex [&>span]:w-full [&>span]:items-center [&>span]:gap-1 [&>span]:truncate [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0',
// props.isCollapsed &&
// 'flex h-9 w-9 shrink-0 items-center justify-center p-0 [&>span]:w-auto [&>svg]:hidden'
// )}
// aria-label="Select workspace"
// >
// <SelectValue placeholder="Select workspace">
// <RiRocket2Fill />

// <span className={cn('ml-2', props.isCollapsed && 'hidden')}>
// {userInfo.currentWorkspace.name}
// </span>
// </SelectValue>
// </SelectTrigger>
// <SelectContent>
// {userInfo.workspaces.map((w) => (
// <SelectItem key={w.workspace.id} value={w.workspace.id}>
// <div className="[&_svg]:text-foreground flex items-center gap-3 [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0">
// <RiRocket2Fill />
// {w.workspace.name}
// </div>
// </SelectItem>
// ))}

// <SelectSeparator />

// <SelectItem
// value="create"
// onClick={() => console.log('aa')}
// onSelect={() => console.log('bbb')}
// >
// <div className="[&_svg]:text-foreground flex items-center gap-3 [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0">
// <LuPlus />
// {t('Create Workspace')}
// </div>
// </SelectItem>
// </SelectContent>
// </Select>
// );
}
);
WorkspaceSwitcher.displayName = 'WorkspaceSwitcher';
2 changes: 1 addition & 1 deletion src/client/components/layout/DesktopLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const DesktopLayout: React.FC<LayoutProps> = React.memo((props) => {
defaultValue: false,
}
);
const workspaceId = useUserStore((state) => state.info?.currentWorkspace?.id);
const workspaceId = useUserStore((state) => state.info?.currentWorkspaceId);
const { data: serviceCount } = trpc.workspace.getServiceCount.useQuery(
{
workspaceId: workspaceId!,
Expand Down
4 changes: 2 additions & 2 deletions src/server/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export function createTestContext() {
});

await prisma.workspace.delete({
where: { id: data.currentWorkspace.id },
where: { id: data.currentWorkspaceId! },
});
});

return {
user: data,
workspace: data.currentWorkspace,
workspace: data.workspaces[0].workspace,
};
};

Expand Down

0 comments on commit 95b51ca

Please sign in to comment.