Move constants from electron/constants.ts into src/common/constants.js

This commit is contained in:
Jonatan Heyman 2025-01-06 16:06:33 +01:00
parent 3fbb3e324a
commit 64740192bf
7 changed files with 21 additions and 18 deletions

View File

@ -1,13 +0,0 @@
export const WINDOW_CLOSE_EVENT = "window-close"
export const OPEN_SETTINGS_EVENT = "open-settings"
export const SETTINGS_CHANGE_EVENT = "settings-change"
export const UPDATE_AVAILABLE_EVENT = "update-available"
export const UPDATE_NOT_AVAILABLE_EVENT = "update-not-available"
export const UPDATE_DOWNLOADED = "update-downloaded"
export const UPDATE_ERROR = "update-error"
export const UPDATE_DOWNLOAD_PROGRESS = "update-download-progress"
export const UPDATE_START_DOWNLOAD = "auto-update:startDownload"
export const UPDATE_INSTALL_AND_RESTART = "auto-update:installAndRestart"
export const UPDATE_CHECK_FOR_UPDATES = "auto-update:checkForUpdates"

View File

@ -11,7 +11,7 @@ import {
UPDATE_START_DOWNLOAD,
UPDATE_INSTALL_AND_RESTART,
UPDATE_CHECK_FOR_UPDATES,
} from '../constants'
} from '@/src/common/constants'
import { setForceQuit } from "./index";

View File

@ -3,8 +3,9 @@ import { release } from 'node:os'
import { join } from 'node:path'
import fs from "fs"
import { WINDOW_CLOSE_EVENT, SETTINGS_CHANGE_EVENT } from '@/src/common/constants'
import { menu, getTrayMenu } from './menu'
import { WINDOW_CLOSE_EVENT, SETTINGS_CHANGE_EVENT } from '../constants';
import CONFIG from "../config"
import { isDev, isLinux, isMac, isWindows } from '../detect-platform';
import { initializeAutoUpdate, checkForUpdates } from './auto-update';

View File

@ -1,5 +1,5 @@
const { app, Menu } = require("electron")
import { OPEN_SETTINGS_EVENT } from "../constants";
import { OPEN_SETTINGS_EVENT } from "@/src/common/constants";
import { openAboutWindow } from "./about";
import { quit } from "./index"

View File

@ -14,7 +14,7 @@ import {
UPDATE_INSTALL_AND_RESTART,
UPDATE_DOWNLOADED,
UPDATE_CHECK_FOR_UPDATES,
} from "../constants"
} from "@/src/common/constants"
import CONFIG from "../config"
import getCurrencyData from "./currency"

View File

@ -1,2 +1,17 @@
export const SCRATCH_FILE_NAME = "scratch.txt"
export const AUTO_SAVE_INTERVAL = 2000
export const WINDOW_CLOSE_EVENT = "window-close"
export const OPEN_SETTINGS_EVENT = "open-settings"
export const SETTINGS_CHANGE_EVENT = "settings-change"
export const REDO_EVENT = "redo"
export const UPDATE_AVAILABLE_EVENT = "update-available"
export const UPDATE_NOT_AVAILABLE_EVENT = "update-not-available"
export const UPDATE_DOWNLOADED = "update-downloaded"
export const UPDATE_ERROR = "update-error"
export const UPDATE_DOWNLOAD_PROGRESS = "update-download-progress"
export const UPDATE_START_DOWNLOAD = "auto-update:startDownload"
export const UPDATE_INSTALL_AND_RESTART = "auto-update:installAndRestart"
export const UPDATE_CHECK_FOR_UPDATES = "auto-update:checkForUpdates"

View File

@ -17,7 +17,7 @@
"@/*": ["./*"],
}
},
"include": ["src"," shared-utils"],
"include": ["src"," shared-utils", "electron"],
"references": [
{ "path": "./tsconfig.node.json" }
]