🐛 still asking for permissions excessively

This commit is contained in:
TC
2026-06-16 22:38:44 +10:00
parent 2ca5e92fd5
commit 833385c8d8
3 changed files with 7 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ try {
export const getConfigDir = (): string => CONFIG_DIR
export const getDraftRoot = (): string =>
_config.projectPath ?? process.env.DRAFT_PATH ?? join(app.getPath('documents'), 'Hohoff')
_config.projectPath ?? process.env.DRAFT_PATH ?? join(homedir(), 'Documents', 'Hohoff')
export const getApiKey = (): string | undefined =>
_config.apiKey ?? process.env.ANTHROPIC_API_KEY

View File

@@ -4,6 +4,7 @@ import { electronApp, optimizer, is } from '@electron-toolkit/utils'
import { registerIpcHandlers, setOnProjectChanged } from './ipcHandlers'
import { flushTelemetry } from './telemetry'
import { getDraftRoot, getRecentProjects, writeGlobalConfig } from './globalConfig'
import { mkdirSync } from 'fs'
app.setName('Hohoff')
@@ -272,6 +273,10 @@ app.whenReady().then(() => {
optimizer.watchWindowShortcuts(window)
})
// Touch the draft root once before the window loads so macOS issues a single
// TCC prompt here rather than one per concurrent renderer IPC call.
try { mkdirSync(getDraftRoot(), { recursive: true }) } catch { /* ignore */ }
registerIpcHandlers()
const mainWindow = createWindow()
buildAppMenu(mainWindow)

File diff suppressed because one or more lines are too long