Skip to content

Commit 9910ca8

Browse files
committed
feat: random app.
1 parent a6a4980 commit 9910ca8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/components/CommandPalette.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,17 @@ const CommandPalette = ({ isOpen, setIsOpen, openGenericModal, toggleDigitalRain
170170
addToast({ title: 'Reloading', message: 'Page will reload shortly...', duration: 1500 });
171171
setTimeout(() => window.location.reload(), 1500);
172172
break;
173+
case 'randomApp': {
174+
const apps = items.filter(i => i.type === 'app');
175+
if (apps.length > 0) {
176+
const randomApp = apps[Math.floor(Math.random() * apps.length)];
177+
addToast({ title: 'Random App', message: `Navigating to ${randomApp.title}`, duration: 2000 });
178+
navigate(randomApp.path);
179+
} else {
180+
addToast({ title: 'Random App', message: 'No apps found to navigate to.', duration: 2000 });
181+
}
182+
break;
183+
}
173184
default:
174185
break;
175186
}

src/hooks/useSearchableData.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ const useSearchableData = () => {
8484
{ title: 'Copy Current URL', type: 'command', commandId: 'copyCurrentURL' },
8585
{ title: 'Clear Local Storage', type: 'command', commandId: 'clearLocalStorage' },
8686
{ title: 'Reload Page', type: 'command', commandId: 'reloadPage' },
87+
{ title: 'Go to Random App', type: 'command', commandId: 'randomApp' },
8788
{ title: 'Her Daim', type: 'command', commandId: 'herDaim' },
8889
];
8990

0 commit comments

Comments
 (0)