Skip to content

Commit 2ddb802

Browse files
committed
fix: conflicting records
1 parent 0ba611c commit 2ddb802

File tree

6 files changed

+1
-99
lines changed

6 files changed

+1
-99
lines changed

apps/dashboard/app/(main)/settings/_components/settings-section.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,6 @@ export function UnsavedChangesFooter({
9797
saveLabel = "Save Changes",
9898
message = "You have unsaved changes",
9999
}: UnsavedChangesFooterProps) {
100-
useHotkeys(
101-
"mod+s",
102-
(e) => {
103-
if (hasChanges && !isSaving) {
104-
e.preventDefault();
105-
onSave();
106-
}
107-
},
108-
{ preventDefault: true, enabled: hasChanges && !isSaving },
109-
[hasChanges, isSaving, onSave]
110-
);
111-
112100
useHotkeys(
113101
"escape",
114102
() => {

apps/dashboard/app/(main)/websites/page.tsx

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
TrendUpIcon,
88
} from "@phosphor-icons/react";
99
import { useState } from "react";
10-
import { useHotkeys } from "react-hotkeys-hook";
1110
import { EmptyState } from "@/components/empty-state";
1211
import { Button } from "@/components/ui/button";
1312
import { Card, CardContent, CardHeader } from "@/components/ui/card";
@@ -64,34 +63,6 @@ export default function WebsitesPage() {
6463
refetch,
6564
} = useWebsites();
6665

67-
const canCreateWebsite = !dialogOpen;
68-
const isLoadingOrFetching = isLoading || isFetching;
69-
const canRefresh = !isLoadingOrFetching;
70-
71-
useHotkeys(
72-
"mod+n",
73-
(e) => {
74-
if (canCreateWebsite) {
75-
e.preventDefault();
76-
setDialogOpen(true);
77-
}
78-
},
79-
{ preventDefault: true, enabled: canCreateWebsite },
80-
[canCreateWebsite]
81-
);
82-
83-
useHotkeys(
84-
"mod+shift+r",
85-
(e) => {
86-
if (canRefresh) {
87-
e.preventDefault();
88-
refetch();
89-
}
90-
},
91-
{ preventDefault: true, enabled: canRefresh },
92-
[canRefresh, refetch]
93-
);
94-
9566
return (
9667
<div className="flex h-full flex-col">
9768
{/* Enhanced header */}

apps/dashboard/components/charts/annotation-modal.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,6 @@ export function AnnotationModal(props: AnnotationModalProps) {
164164
}
165165
};
166166

167-
useHotkeys(
168-
"mod+enter",
169-
(e) => {
170-
if (isOpen && text.trim() && !submitting && !isSubmitting) {
171-
e.preventDefault();
172-
handleSubmit();
173-
}
174-
},
175-
{
176-
preventDefault: true,
177-
enabled: isOpen && Boolean(text.trim()) && !submitting && !isSubmitting,
178-
},
179-
[isOpen, text, submitting, isSubmitting, handleSubmit]
180-
);
181-
182167
const getDateRangeText = () => {
183168
if (mode === "edit") {
184169
const { annotation } = props as EditModeProps;

apps/dashboard/components/layout/theme-toggle.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { MonitorIcon, MoonIcon, SunIcon } from "@phosphor-icons/react";
44
import { useTheme } from "next-themes";
5-
import { useHotkeys } from "react-hotkeys-hook";
65
import { Button } from "@/components/ui/button";
76
import { cn } from "@/lib/utils";
87

@@ -32,15 +31,6 @@ export function ThemeToggle({ className }: ThemeTogglerProps) {
3231
});
3332
};
3433

35-
useHotkeys(
36-
"mod+d",
37-
() => {
38-
switchTheme();
39-
},
40-
{ preventDefault: true },
41-
[currentTheme]
42-
);
43-
4434
return (
4535
<Button
4636
aria-label="Toggle theme"

apps/dashboard/components/ui/keyboard-shortcuts.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,12 @@ const SHORTCUT_GROUPS: ShortcutGroup[] = [
1616
title: "General",
1717
shortcuts: [
1818
{ label: "Search", keys: "Ctrl+K", macKeys: "⌘K" },
19-
{ label: "Toggle theme", keys: "Ctrl+D", macKeys: "⌘D" },
20-
],
21-
},
22-
{
23-
title: "Websites",
24-
shortcuts: [
25-
{ label: "Create new website", keys: "Ctrl+N", macKeys: "⌘N" },
26-
{ label: "Refresh websites", keys: "Ctrl+Shift+R", macKeys: "⌘⇧R" },
2719
],
2820
},
2921
{
3022
title: "Forms & Dialogs",
3123
shortcuts: [
32-
{ label: "Save changes", keys: "Ctrl+S", macKeys: "⌘S" },
33-
{ label: "Submit form", keys: "Ctrl+Enter", macKeys: "⌘↵" },
24+
{ label: "Submit form", keys: "Enter" },
3425
{ label: "Close dialog", keys: "Esc" },
3526
],
3627
},

apps/dashboard/components/website-dialog.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { zodResolver } from "@hookform/resolvers/zod";
55
import { LoaderCircle } from "lucide-react";
66
import { useEffect, useRef } from "react";
77
import { useForm } from "react-hook-form";
8-
import { useHotkeys } from "react-hotkeys-hook";
98
import { toast } from "sonner";
109
import { z } from "zod";
1110
import { useOrganizationsContext } from "@/components/providers/organizations-provider";
@@ -157,28 +156,6 @@ export function WebsiteDialog({
157156
}
158157
});
159158

160-
useHotkeys(
161-
"mod+enter",
162-
(e) => {
163-
if (
164-
open &&
165-
form.formState.isValid &&
166-
!createWebsiteMutation.isPending &&
167-
!updateWebsiteMutation.isPending
168-
) {
169-
e.preventDefault();
170-
handleSubmit();
171-
}
172-
},
173-
{ preventDefault: true, enabled: open },
174-
[
175-
open,
176-
form.formState.isValid,
177-
createWebsiteMutation.isPending,
178-
updateWebsiteMutation.isPending,
179-
]
180-
);
181-
182159
return (
183160
<Dialog onOpenChange={onOpenChange} open={open}>
184161
<DialogContent className="w-[95vw] max-w-md sm:w-full">

0 commit comments

Comments
 (0)