Merge 64fc9af918 into 00c7572cd0
This commit is contained in:
commit
d7bbfa4f79
|
|
@ -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": "^_"
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
|
@ -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 + "/**/*"),
|
||||
// ],
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
569
pnpm-lock.yaml
569
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
12
src/main.ts
12
src/main.ts
|
|
@ -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") {
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
/// <reference types="vite/client" />
|
||||
|
||||
declare module '*?asset' {
|
||||
const assetPath: string;
|
||||
export default assetPath;
|
||||
}
|
||||
Loading…
Reference in New Issue