🐛 still asking for permissions excessively
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user