Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(app): backfill disabledShortcuts to prevent app-wide crash (#5030)

Ezra Elletteb91de719714b
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
index 51300bd61..fba031f3a 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx
@@ -1045,6 +1045,14 @@ function createSettingsStore() {
}
}
+ // Migration: backfill disabledShortcuts for installs that predate the
+ // field. Several call sites assume it's always an array (`.includes(...)`)
+ // and crash with "Cannot read properties of undefined" when it's missing.
+ if (!Array.isArray(settings.disabledShortcuts)) {
+ settings.disabledShortcuts = [];
+ needsUpdate = true;
+ }
+
// Save migrations if needed
if (needsUpdate) {
await setSettingsStripped(store, settings);