Skip to content

Commit 4dba4d2

Browse files
committed
app: copy current url
1 parent 8480d99 commit 4dba4d2

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/components/CommandPalette.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ const CommandPalette = ({ isOpen, setIsOpen, openGenericModal, toggleDigitalRain
158158
openGenericModal('User/Browser Information', osInfo);
159159
break;
160160
}
161+
case 'copyCurrentURL':
162+
navigator.clipboard.writeText(window.location.href);
163+
addToast({ title: 'Copied', message: 'Current URL copied to clipboard!', duration: 3000 });
164+
break;
161165
default:
162166
break;
163167
}

src/hooks/useSearchableData.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const useSearchableData = () => {
8181
{ title: 'Leet Speak Transformer', type: 'command', commandId: 'leetTransformer' },
8282
{ title: 'Show Quick Stopwatch', type: 'command', commandId: 'stopwatch' },
8383
{ title: 'Show User/Browser Information', type: 'command', commandId: 'showOSInfo' },
84+
{ title: 'Copy Current URL', type: 'command', commandId: 'copyCurrentURL' },
8485
{ title: 'Her Daim', type: 'command', commandId: 'herDaim' },
8586
];
8687

0 commit comments

Comments
 (0)