This commit is contained in:
Lynden Sylvester 2026-04-06 17:33:13 +01:00 committed by GitHub
commit d7bbfa4f79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 607 additions and 7 deletions

View File

@ -12,5 +12,21 @@
"plugin:import/electron",
"plugin:import/typescript"
],
"parser": "@typescript-eslint/parser"
}
"parser": "@typescript-eslint/parser",
"settings": {
"import/resolver": {
"node": {
"extensions": [".ts", ".tsx", ".js", ".jsx"]
}
}
},
"rules": {
"import/no-unresolved": ["error", {
"ignore": ["\\\\?asset$"]
}],
"@typescript-eslint/no-unused-vars": ["warn", {
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}]
}
}

View File

@ -135,7 +135,10 @@ const config: ForgeConfig = {
name: STRINGS.name,
executableName: STRINGS.execName,
icon: `${ASSET_DIR}/icon`,
// extraResource: [
extendInfo: {
NSMicrophoneUsageDescription:
"Stoat needs access to the microphone to enable voice chat features.",
}, // extraResource: [
// // include all the asset files
// ...globSync(ASSET_DIR + "/**/*"),
// ],

View File

@ -37,6 +37,7 @@
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"electron": "38.1.2",
"electron-vite": "^5.0.0",
"eslint": "^8.57.1",
"eslint-plugin-import": "^2.32.0",
"json-schema-typed": "^8.0.1",

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
import { IUpdateInfo, updateElectronApp } from "update-electron-app";
import { BrowserWindow, Notification, app, shell } from "electron";
import { BrowserWindow, Notification, app, shell, systemPreferences } from "electron";
import started from "electron-squirrel-startup";
import { autoLaunch } from "./native/autoLaunch";
@ -39,10 +39,18 @@ if (acquiredLock) {
updateElectronApp({ onNotifyUser });
// create and configure the app when electron is ready
app.on("ready", () => {
app.on("ready", async () => {
// create window and application contexts
createMainWindow();
// -- macOS Microphone Permission --
try {
const granted = await systemPreferences.askForMediaAccess("microphone");
console.log("Microphone access granted:", granted);
} catch (error) {
console.error("Error requesting microphone access:", error);
}
// -----------------------------------
// enable auto start on Windows and MacOS
if (config.firstLaunch) {
if (process.platform === "win32" || process.platform === "darwin") {

View File

@ -2,6 +2,7 @@ import AutoLaunch from "auto-launch";
import { ipcMain } from "electron";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { mainWindow } from "./window";
export const autoLaunch = new AutoLaunch({

6
src/native/vite-env.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
/// <reference types="vite/client" />
declare module '*?asset' {
const assetPath: string;
export default assetPath;
}