Skip to content

Commit 5861388

Browse files
authored
improvement(redirects): move redirects to middleware, push to login if no session and workspace if session exists, remove telemetry consent dialog (#976)
* improvement(redirects): move redirects to middleware, push to login if no session and workspace if session exists * remove telemetry consent dialog * remove migrations * rerun migrations
1 parent f1fe2f5 commit 5861388

File tree

14 files changed

+5902
-297
lines changed

14 files changed

+5902
-297
lines changed

apps/sim/app/api/users/me/settings/route.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const SettingsSchema = z.object({
1616
autoPan: z.boolean().optional(),
1717
consoleExpandedByDefault: z.boolean().optional(),
1818
telemetryEnabled: z.boolean().optional(),
19-
telemetryNotifiedUser: z.boolean().optional(),
2019
emailPreferences: z
2120
.object({
2221
unsubscribeAll: z.boolean().optional(),
@@ -35,7 +34,6 @@ const defaultSettings = {
3534
autoPan: true,
3635
consoleExpandedByDefault: true,
3736
telemetryEnabled: true,
38-
telemetryNotifiedUser: false,
3937
emailPreferences: {},
4038
}
4139

@@ -69,7 +67,6 @@ export async function GET() {
6967
autoPan: userSettings.autoPan,
7068
consoleExpandedByDefault: userSettings.consoleExpandedByDefault,
7169
telemetryEnabled: userSettings.telemetryEnabled,
72-
telemetryNotifiedUser: userSettings.telemetryNotifiedUser,
7370
emailPreferences: userSettings.emailPreferences ?? {},
7471
},
7572
},

apps/sim/app/layout.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { env } from '@/lib/env'
88
import { isHosted } from '@/lib/environment'
99
import { createLogger } from '@/lib/logs/console/logger'
1010
import { getAssetUrl } from '@/lib/utils'
11-
import { TelemetryConsentDialog } from '@/app/telemetry-consent-dialog'
1211
import '@/app/globals.css'
1312

1413
import { ZoomPrevention } from '@/app/zoom-prevention'
@@ -110,7 +109,6 @@ export default function RootLayout({ children }: { children: React.ReactNode })
110109
<body suppressHydrationWarning>
111110
<BrandedLayout>
112111
<ZoomPrevention />
113-
<TelemetryConsentDialog />
114112
{children}
115113
{isHosted && (
116114
<>

apps/sim/app/telemetry-consent-dialog.tsx

Lines changed: 0 additions & 251 deletions
This file was deleted.

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/privacy/privacy.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export function Privacy() {
1818
const isLoading = useGeneralStore((state) => state.isLoading)
1919
const telemetryEnabled = useGeneralStore((state) => state.telemetryEnabled)
2020
const setTelemetryEnabled = useGeneralStore((state) => state.setTelemetryEnabled)
21-
const setTelemetryNotifiedUser = useGeneralStore((state) => state.setTelemetryNotifiedUser)
2221
const loadSettings = useGeneralStore((state) => state.loadSettings)
2322

2423
useEffect(() => {
@@ -29,8 +28,6 @@ export function Privacy() {
2928
setTelemetryEnabled(checked)
3029

3130
if (checked) {
32-
setTelemetryNotifiedUser(true)
33-
3431
if (typeof window !== 'undefined') {
3532
fetch('/api/telemetry', {
3633
method: 'POST',
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE "settings" DROP COLUMN "telemetry_notified_user";

0 commit comments

Comments
 (0)