Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 07:00 UTC
refactor: deduplicate detectMac into single export
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmitha Mallesh committed
Feb 22, 2026 at 12:50 UTC
f4d45cf72045bc826e5dbe880d0418d35fc5c5a4
2 files changed
+2
-13
docs/components/ask-ai-button.tsx
+1
-1
@@ -26,7 +26,7 @@ export function toggleDecimalWidget() {
26
widgetOpen = !widgetOpen;
27
}
28
29
-function detectMac(): boolean {
29
+export function detectMac(): boolean {
30
try {
31
if ('userAgentData' in navigator) {
32
return (navigator as Navigator & { userAgentData?: { platform?: string } }).userAgentData?.platform === 'macOS';
docs/components/custom-search-dialog.tsx
+1
-12
@@ -16,18 +16,7 @@ import {
16
import { useI18n } from 'fumadocs-ui/contexts/i18n';
17
import { useDocsSearch } from 'fumadocs-core/search/client';
18
import { BotMessageSquare } from 'lucide-react';
19
-import { toggleDecimalWidget } from './ask-ai-button';
20
-
21
-function detectMac(): boolean {
22
- try {
23
- if ('userAgentData' in navigator) {
24
- return (navigator as Navigator & { userAgentData?: { platform?: string } }).userAgentData?.platform === 'macOS';
25
- }
26
- return /mac/i.test(navigator.platform);
27
- } catch {
28
- return true; // default to Mac
29
- }
30
-}
19
+import { toggleDecimalWidget, detectMac } from './ask-ai-button';
20
21
function MetaKey() {
22
const [key, setKey] = useState('⌘');