Compare commits
4 Commits
fix/checkl
...
chore/clea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bdebc3917f | ||
|
|
ac040e8cad | ||
|
|
15506d3a81 | ||
|
|
ec506fa33c |
@@ -53,7 +53,6 @@ const config = {
|
|||||||
{
|
{
|
||||||
protocol: 'https',
|
protocol: 'https',
|
||||||
hostname: 'cdn.discordapp.com',
|
hostname: 'cdn.discordapp.com',
|
||||||
pathname: '/avatars/**',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -95,12 +94,6 @@ const config = {
|
|||||||
swcPlugins: [["@lingui/swc-plugin", {}]],
|
swcPlugins: [["@lingui/swc-plugin", {}]],
|
||||||
},
|
},
|
||||||
|
|
||||||
api: {
|
|
||||||
bodyParser: {
|
|
||||||
sizeLimit: env("NEXT_API_BODY_SIZE_LIMIT") || '1mb',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,9 +55,10 @@ export default function SideNavigation({
|
|||||||
const [isInitialised, setIsInitialised] = useState(false);
|
const [isInitialised, setIsInitialised] = useState(false);
|
||||||
const { openModal } = useModal();
|
const { openModal } = useModal();
|
||||||
|
|
||||||
const { data: workspaceData } = api.workspace.byId.useQuery({
|
const { data: workspaceData } = api.workspace.byId.useQuery(
|
||||||
workspacePublicId: workspace.publicId,
|
{ workspacePublicId: workspace.publicId },
|
||||||
});
|
{ enabled: !!workspace.publicId && workspace.publicId.length >= 12 },
|
||||||
|
);
|
||||||
|
|
||||||
const subscriptions = workspaceData?.subscriptions as
|
const subscriptions = workspaceData?.subscriptions as
|
||||||
| Subscription[]
|
| Subscription[]
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
|
import React from "react";
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogBackdrop,
|
DialogBackdrop,
|
||||||
@@ -464,19 +465,37 @@ function FormattedShortcut({ shortcut }: { shortcut: KeyboardShortcut }) {
|
|||||||
? stroke.modifiers.map(stringifyModifier)
|
? stroke.modifiers.map(stringifyModifier)
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
modifierStrings.forEach((mod) => {
|
modifierStrings.forEach((mod, index) => {
|
||||||
parts.push(<kbd className={kbdClassName}>{mod}</kbd>);
|
parts.push(
|
||||||
|
<kbd key={`mod-${index}-${mod}`} className={kbdClassName}>
|
||||||
|
{mod}
|
||||||
|
</kbd>,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
parts.push(<kbd className={kbdClassName}>{stroke.key.toUpperCase()}</kbd>);
|
parts.push(
|
||||||
|
<kbd key={`key-${stroke.key}`} className={kbdClassName}>
|
||||||
|
{stroke.key.toUpperCase()}
|
||||||
|
</kbd>,
|
||||||
|
);
|
||||||
|
|
||||||
return parts;
|
return parts;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (shortcut.type === "SEQUENCE") {
|
if (shortcut.type === "SEQUENCE") {
|
||||||
const parts: ReactNode[] = [];
|
const parts: ReactNode[] = [];
|
||||||
shortcut.strokes.forEach((stroke) => {
|
shortcut.strokes.forEach((stroke, strokeIndex) => {
|
||||||
parts.push(...formatStroke(stroke));
|
const strokeParts = formatStroke(stroke);
|
||||||
|
// Add stroke index to keys to ensure uniqueness across multiple strokes
|
||||||
|
const keyedParts = strokeParts.map((part, partIndex) => {
|
||||||
|
if (React.isValidElement(part)) {
|
||||||
|
return React.cloneElement(part, {
|
||||||
|
key: `stroke-${strokeIndex}-${part.key || partIndex}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return part;
|
||||||
|
});
|
||||||
|
parts.push(...keyedParts);
|
||||||
});
|
});
|
||||||
return <span className="flex items-center gap-1 text-[11px]">{parts}</span>;
|
return <span className="flex items-center gap-1 text-[11px]">{parts}</span>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ export async function invalidateCard(
|
|||||||
utils: ReturnType<typeof api.useUtils>,
|
utils: ReturnType<typeof api.useUtils>,
|
||||||
cardPublicId: string,
|
cardPublicId: string,
|
||||||
) {
|
) {
|
||||||
|
if (!cardPublicId || cardPublicId.length < 12) return;
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
utils.card.byId.invalidate({ cardPublicId }),
|
utils.card.byId.invalidate({ cardPublicId }),
|
||||||
utils.card.getActivities.invalidate({ cardPublicId }),
|
utils.card.getActivities.invalidate({ cardPublicId }),
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ const ActivityList = ({
|
|||||||
limit: ACTIVITIES_PAGE_SIZE,
|
limit: ACTIVITIES_PAGE_SIZE,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
enabled: !!cardPublicId,
|
enabled: !!cardPublicId && cardPublicId.length >= 12,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -53,9 +53,10 @@ export function CardRightPanel({ isTemplate }: { isTemplate?: boolean }) {
|
|||||||
? router.query.cardId[0]
|
? router.query.cardId[0]
|
||||||
: router.query.cardId;
|
: router.query.cardId;
|
||||||
|
|
||||||
const { data: card } = api.card.byId.useQuery({
|
const { data: card } = api.card.byId.useQuery(
|
||||||
cardPublicId: cardId ?? "",
|
{ cardPublicId: cardId ?? "" },
|
||||||
});
|
{ enabled: !!cardId && cardId.length >= 12 },
|
||||||
|
);
|
||||||
|
|
||||||
const isCreator = card?.createdBy && session?.user.id === card.createdBy;
|
const isCreator = card?.createdBy && session?.user.id === card.createdBy;
|
||||||
const canEdit = canEditCard || isCreator;
|
const canEdit = canEditCard || isCreator;
|
||||||
@@ -184,9 +185,10 @@ export default function CardPage({ isTemplate }: { isTemplate?: boolean }) {
|
|||||||
? router.query.cardId[0]
|
? router.query.cardId[0]
|
||||||
: router.query.cardId;
|
: router.query.cardId;
|
||||||
|
|
||||||
const { data: card, isLoading } = api.card.byId.useQuery({
|
const { data: card, isLoading } = api.card.byId.useQuery(
|
||||||
cardPublicId: cardId ?? "",
|
{ cardPublicId: cardId ?? "" },
|
||||||
});
|
{ enabled: !!cardId && cardId.length >= 12 },
|
||||||
|
);
|
||||||
|
|
||||||
const isCreator = card?.createdBy && session?.user.id === card.createdBy;
|
const isCreator = card?.createdBy && session?.user.id === card.createdBy;
|
||||||
const canEdit = canEditCard || isCreator;
|
const canEdit = canEditCard || isCreator;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export default function MembersPage() {
|
|||||||
|
|
||||||
const { data, isLoading } = api.workspace.byId.useQuery(
|
const { data, isLoading } = api.workspace.byId.useQuery(
|
||||||
{ workspacePublicId: workspace.publicId },
|
{ workspacePublicId: workspace.publicId },
|
||||||
// { enabled: workspace?.publicId ? true : false },
|
{ enabled: !!workspace.publicId && workspace.publicId.length >= 12 },
|
||||||
);
|
);
|
||||||
|
|
||||||
const { data: session } = authClient.useSession();
|
const { data: session } = authClient.useSession();
|
||||||
@@ -48,9 +48,11 @@ export default function MembersPage() {
|
|||||||
|
|
||||||
const updateRoleMutation = api.member.updateRole.useMutation({
|
const updateRoleMutation = api.member.updateRole.useMutation({
|
||||||
onSuccess: async () => {
|
onSuccess: async () => {
|
||||||
await utils.workspace.byId.invalidate({
|
if (workspace.publicId && workspace.publicId.length >= 12) {
|
||||||
workspacePublicId: workspace.publicId,
|
await utils.workspace.byId.invalidate({
|
||||||
});
|
workspacePublicId: workspace.publicId,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
showPopup({
|
showPopup({
|
||||||
header: t`Role updated`,
|
header: t`Role updated`,
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export function CardModal({
|
|||||||
cardPublicId: cardPublicId ?? "",
|
cardPublicId: cardPublicId ?? "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
enabled: isOpen && !!cardPublicId,
|
enabled: isOpen && !!cardPublicId && cardPublicId.length >= 12,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,11 @@ export default function PermissionsSettings() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Refresh any relevant workspace data
|
// Refresh any relevant workspace data
|
||||||
await utils.workspace.byId.invalidate({
|
if (workspace.publicId && workspace.publicId.length >= 12) {
|
||||||
workspacePublicId: workspace.publicId,
|
await utils.workspace.byId.invalidate({
|
||||||
});
|
workspacePublicId: workspace.publicId,
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onError: () => {
|
onError: () => {
|
||||||
showPopup({
|
showPopup({
|
||||||
|
|||||||
@@ -31,9 +31,10 @@ export default function WorkspaceSettings() {
|
|||||||
const { data } = api.user.getUser.useQuery();
|
const { data } = api.user.getUser.useQuery();
|
||||||
const [hasOpenedUpgradeModal, setHasOpenedUpgradeModal] = useState(false);
|
const [hasOpenedUpgradeModal, setHasOpenedUpgradeModal] = useState(false);
|
||||||
|
|
||||||
const { data: workspaceData } = api.workspace.byId.useQuery({
|
const { data: workspaceData } = api.workspace.byId.useQuery(
|
||||||
workspacePublicId: workspace.publicId,
|
{ workspacePublicId: workspace.publicId },
|
||||||
});
|
{ enabled: !!workspace.publicId && workspace.publicId.length >= 12 },
|
||||||
|
);
|
||||||
|
|
||||||
const subscriptions = workspaceData?.subscriptions as
|
const subscriptions = workspaceData?.subscriptions as
|
||||||
| Subscription[]
|
| Subscription[]
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ export default function UpdateWorkspaceEmailVisibilityForm({
|
|||||||
|
|
||||||
const updateWorkspace = api.workspace.update.useMutation({
|
const updateWorkspace = api.workspace.update.useMutation({
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
void utils.workspace.byId.invalidate({
|
if (workspacePublicId && workspacePublicId.length >= 12) {
|
||||||
workspacePublicId,
|
void utils.workspace.byId.invalidate({
|
||||||
});
|
workspacePublicId,
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user