Skip to content

Commit

Permalink
fix start app is not resgin recordShortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiram committed Mar 4, 2024
1 parent 630b308 commit 48ff5af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 0 additions & 6 deletions src/main/core/db/init/tbl_setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
{ "key": "theme",
"value": "auto"
},
{ "key": "externalPlayer",
"value": ""
},
{ "key": "defaultHot",
"value": "kylive"
},
Expand Down Expand Up @@ -38,9 +35,6 @@
{ "key": "iptvStatus",
"value": false
},
{ "key": "pauseWhenMinimize",
"value": true
},
{ "key": "defaultSite",
"value": null
},
Expand Down
9 changes: 8 additions & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import logger from './core/logger';
import autoUpdater from './core/update';
import createTray from './core/tray';


import loadHtml from '../../resources/html/load.html?asset'

/**
Expand Down Expand Up @@ -45,6 +44,8 @@ if (!setting.find({ key: "hardwareAcceleration" }).value) {
app.disableHardwareAcceleration();
};

let shortcutsState: any = setting.find({ key: "recordShortcut" }).value;

let uaState: any = setting.find({ key: "ua" }).value;

let windowState: any = setting.find({ key: "windowPosition" }).value || {
Expand Down Expand Up @@ -264,6 +265,12 @@ app.whenReady().then(async() => {
createMenu();
// 快捷键
// createGlobalShortcut(mainWindow);
if (shortcutsState) {
globalShortcut.register(shortcutsState, () => {
// Do stuff when Y and either Command/Control is pressed.
showOrHidden();
});
}

app.on('activate', function () {
// On macOS it's common to re-create a window in the app when the
Expand Down
5 changes: 1 addition & 4 deletions src/renderer/src/pages/setting/base/BaseSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ const theme = computed(() => {
const formData = ref({
version: '3.3.2',
theme: 'auto',
externalPlayer: '',
defaultHot: 'kylive',
defaultSearchRecommend: 'site',
defaultSearchType: 'site',
Expand All @@ -223,8 +222,6 @@ const formData = ref({
iptvSkipIpv6: true,
iptvThumbnail: false,
iptvStatus: false,
restoreWindowPositionAndSize: false,
pauseWhenMinimize: true,
defaultSite: null,
defaultIptv: null,
defaultAnalyze: null,
Expand All @@ -240,7 +237,7 @@ const formData = ref({
snifferType: 'pie',
softSolution: false,
skipStartEnd: false,
agreementMask: 'false',
agreementMask: false,
recordShortcut: '',
selfBoot: false,
hardwareAcceleration: true,
Expand Down

0 comments on commit 48ff5af

Please sign in to comment.