mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-17 18:35:19 +02:00
remove dead code: allPermissionsGranted, simulateCopy, pendingSuggestionText, updateSuggestionText
This commit is contained in:
parent
c5aa869adb
commit
080acf5e0a
7 changed files with 1 additions and 28 deletions
|
|
@ -11,7 +11,6 @@ const SHORTCUT = 'CommandOrControl+Shift+Space';
|
|||
let autocompleteEnabled = true;
|
||||
let savedClipboard = '';
|
||||
let sourceApp = '';
|
||||
let pendingSuggestionText = '';
|
||||
|
||||
function isSurfSenseWindow(): boolean {
|
||||
const app = getFrontmostApp();
|
||||
|
|
@ -72,7 +71,6 @@ async function acceptAndInject(text: string): Promise<void> {
|
|||
|
||||
clipboard.writeText(text);
|
||||
destroySuggestion();
|
||||
pendingSuggestionText = '';
|
||||
|
||||
try {
|
||||
await new Promise((r) => setTimeout(r, 50));
|
||||
|
|
@ -90,10 +88,6 @@ function registerIpcHandlers(): void {
|
|||
});
|
||||
ipcMain.handle(IPC_CHANNELS.DISMISS_SUGGESTION, () => {
|
||||
destroySuggestion();
|
||||
pendingSuggestionText = '';
|
||||
});
|
||||
ipcMain.handle(IPC_CHANNELS.UPDATE_SUGGESTION_TEXT, (_event, text: string) => {
|
||||
pendingSuggestionText = text;
|
||||
});
|
||||
ipcMain.handle(IPC_CHANNELS.SET_AUTOCOMPLETE_ENABLED, (_event, enabled: boolean) => {
|
||||
autocompleteEnabled = enabled;
|
||||
|
|
@ -111,7 +105,6 @@ export function registerAutocomplete(): void {
|
|||
const sw = getSuggestionWindow();
|
||||
if (sw && !sw.isDestroyed()) {
|
||||
destroySuggestion();
|
||||
pendingSuggestionText = '';
|
||||
return;
|
||||
}
|
||||
triggerAutocomplete();
|
||||
|
|
|
|||
|
|
@ -27,11 +27,6 @@ export function getPermissionsStatus(): PermissionsStatus {
|
|||
};
|
||||
}
|
||||
|
||||
export function allPermissionsGranted(): boolean {
|
||||
const status = getPermissionsStatus();
|
||||
return status.accessibility === 'authorized' && status.screenRecording === 'authorized';
|
||||
}
|
||||
|
||||
export function requestAccessibility(): void {
|
||||
if (!isMac()) return;
|
||||
const perms = getNodeMacPermissions();
|
||||
|
|
|
|||
|
|
@ -19,14 +19,6 @@ export function getFrontmostApp(): string {
|
|||
return '';
|
||||
}
|
||||
|
||||
export function simulateCopy(): void {
|
||||
if (process.platform === 'darwin') {
|
||||
execSync('osascript -e \'tell application "System Events" to keystroke "c" using command down\'');
|
||||
} else if (process.platform === 'win32') {
|
||||
execSync('powershell -command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SendKeys]::SendWait(\'^c\')"');
|
||||
}
|
||||
}
|
||||
|
||||
export function simulatePaste(): void {
|
||||
if (process.platform === 'darwin') {
|
||||
execSync('osascript -e \'tell application "System Events" to keystroke "v" using command down\'');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue