- Added a new file renaming functionality in the editor, allowing users to rename files and directories in place. - Introduced notification settings for team inbox messages and task clarifications, enabling users to receive native OS notifications for important updates. - Updated the README to reflect the new features and provide a clearer overview of the task management capabilities. - Improved the application icon handling for notifications across different platforms.
38 lines
979 B
TypeScript
38 lines
979 B
TypeScript
/**
|
|
* Resolves the application icon path for native notifications and windows.
|
|
*
|
|
* On macOS the signed bundle provides the icon automatically,
|
|
* so this is primarily needed for Windows and Linux.
|
|
*/
|
|
|
|
import { existsSync } from 'fs';
|
|
import { join } from 'path';
|
|
|
|
let cachedPath: string | undefined;
|
|
let resolved = false;
|
|
|
|
/**
|
|
* Returns the absolute path to the app icon (PNG), or undefined if not found.
|
|
* Result is cached after the first call.
|
|
*/
|
|
export function getAppIconPath(): string | undefined {
|
|
if (resolved) return cachedPath;
|
|
|
|
const isDev = process.env.NODE_ENV === 'development';
|
|
const candidates = isDev
|
|
? [join(process.cwd(), 'resources/icon.png')]
|
|
: [
|
|
join(process.resourcesPath, 'resources/icon.png'),
|
|
join(__dirname, '../../resources/icon.png'),
|
|
];
|
|
|
|
for (const candidate of candidates) {
|
|
if (existsSync(candidate)) {
|
|
cachedPath = candidate;
|
|
break;
|
|
}
|
|
}
|
|
|
|
resolved = true;
|
|
return cachedPath;
|
|
}
|