Skip to content

Commit d0cd144

Browse files
committed
fix: review from copilot
1 parent 45d7118 commit d0cd144

7 files changed

Lines changed: 17 additions & 16 deletions

File tree

packages/gui/src/background.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
1818
const isDevelopment = process.env.NODE_ENV !== 'production'
1919
const staticPath = isDevelopment
2020
? path.resolve('public')
21-
: path.join(app.getAppPath(), 'dist_electron')
21+
: path.join(app.getAppPath(), 'dist')
2222

2323
let _powerMonitor = powerMonitor
2424

@@ -242,7 +242,7 @@ function createWindow (startHideWindow, autoQuitIfError = true) {
242242
}
243243
} else {
244244
// Load the index.html when not in development
245-
win.loadFile(path.join(app.getAppPath(), 'dist_electron', 'index.html'))
245+
win.loadFile(path.join(app.getAppPath(), 'dist', 'index.html'))
246246
}
247247

248248
if (startHideWindow) {

packages/gui/src/bridge/api/backend.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'node:fs'
22
import path from 'node:path'
33
import { fileURLToPath } from 'node:url'
44
import DevSidecar from '@docmirror/dev-sidecar'
5-
import { ipcMain } from 'electron'
5+
import { app, ipcMain } from 'electron'
66
import lodash from 'lodash'
77
import jsonApi from '@docmirror/mitmproxy/src/json.js'
88
import { createRequire } from 'node:module'
@@ -17,7 +17,7 @@ const { configFromFiles } = coreDefaultConfig
1717

1818
const __dirname = path.dirname(fileURLToPath(import.meta.url))
1919
const mitmproxyPath = path.join(__dirname, '../mitmproxy.js')
20-
process.env.DS_EXTRA_PATH = path.join(__dirname, '../../extra/')
20+
process.env.DS_EXTRA_PATH = path.join(app.getAppPath(), 'extra')
2121
let currentWin
2222

2323
const getDefaultConfigBasePath = function () {

packages/gui/src/bridge/api/open-enable-loopback.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ import { join } from 'node:path'
55
import log from '../../utils/util.log.gui.js'
66

77
const isDevelopment = process.env.NODE_ENV !== 'production'
8-
const staticPath = isDevelopment
9-
? join(process.cwd(), 'public')
10-
: join(app.getAppPath(), 'dist')
8+
const extraPath = join(process.cwd(), 'extra')
119

1210
export default {
1311
open () {
1412
const options = {
1513
name: 'EnableLoopback',
16-
icns: process.platform === 'darwin' ? join(staticPath, 'icon.icns') : undefined,
14+
icns: process.platform === 'darwin' ? join(extraPath, 'icons/icon.icns') : undefined,
1715
env: { PARAM: 'VALUE' },
1816
}
1917
const exeFile = DevSidecar.api.shell.extraPath.getEnableLoopbackPath()

packages/gui/src/bridge/on-close/front.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { h } from 'vue'
1+
import { h, resolveComponent } from 'vue'
22

33
let closeType = 2
44
let doSave = false
@@ -15,20 +15,24 @@ function install (app, api) {
1515

1616
const shortcut = message.showHideShortcut || '无'
1717

18+
const ARadioGroup = resolveComponent('a-radio-group')
19+
const ARadio = resolveComponent('a-radio')
20+
const ACheckbox = resolveComponent('a-checkbox')
21+
1822
// 使用 h 函数创建 VNode
1923
const content = h('div', {}, [
2024
h('div', { style: { marginTop: '10px' } }, [
21-
h('a-radio-group', {
25+
h(ARadioGroup, {
2226
value: closeType,
2327
'onUpdate:value': (val) => { closeType = val },
2428
onChange: onRadioChange,
2529
}, [
26-
h('a-radio', { value: 1 }, '直接关闭'),
27-
h('a-radio', { value: 2 }, '最小化到系统托盘'),
30+
h(ARadio, { value: 1 }, '直接关闭'),
31+
h(ARadio, { value: 2 }, '最小化到系统托盘'),
2832
]),
2933
]),
3034
h('div', { style: { marginTop: '10px' } }, [
31-
h('a-checkbox', {
35+
h(ACheckbox, {
3236
checked: doSave,
3337
'onUpdate:checked': (val) => { doSave = val },
3438
onChange: onCheckChange,

packages/gui/src/view/components/container.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default defineComponent({
99
<template>
1010
<div class="ds-container">
1111
<div class="body-wrapper">
12-
<div v-if="$slots.header?.()" class="container-header">
12+
<div v-if="$slots.header" class="container-header">
1313
<span><slot name="header" /></span>
1414
<span style="color:#999"><slot name="header-right" /></span>
1515
</div>

packages/gui/src/view/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ export default {
444444
}
445445
446446
> button i {
447-
size: 40px;
447+
font-size: 40px;
448448
}
449449
}
450450

packages/gui/vue.config.cjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const { defineConfig } = require('@vue/cli-service')
22
const webpack = require('webpack')
33

44
const publishUrl = process.env.VUE_APP_PUBLISH_URL
5-
const publishProvider = process.env.VUE_APP_PUBLISH_PROVIDER
65
console.log('Publish url:', publishUrl)
76

87
module.exports = defineConfig({

0 commit comments

Comments
 (0)