Skip to content

Commit

Permalink
fix: 🐛 修复 linux 无法启动镜像或录制服务以及修改自定义依赖目录的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Oct 28, 2023
1 parent ad529ca commit d815643
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions electron/events/handles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default (mainWindow) => {

ipcMain.handle(
'show-open-dialog',
async (event, { preset = '', ...options } = {}) => {
async (_, { preset = '', ...options } = {}) => {
// console.log('options', options)
const res = await dialog
.showOpenDialog(options)
Expand All @@ -33,17 +33,17 @@ export default (mainWindow) => {
},
)

ipcMain.handle('open-path', async (event, pathValue) => {
ipcMain.handle('open-path', async (_, pathValue) => {
return shell.openPath(pathValue)
})

ipcMain.handle('show-item-in-folder', async (event, filePath) => {
ipcMain.handle('show-item-in-folder', async (_, filePath) => {
return shell.showItemInFolder(filePath)
})

ipcMain.handle(
'show-save-dialog',
async (event, { filePath = '', ...options } = {}) => {
async (_, { filePath = '', ...options } = {}) => {
const res = await dialog
.showSaveDialog({
...options,
Expand Down
2 changes: 2 additions & 0 deletions electron/exposes/adbkit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ const watch = async (callback) => {
export default () => {
const binPath = appStore.get('common.adbPath') || adbPath

console.log('adb.binPath', binPath)

client = Adb.createClient({
bin: binPath,
})
Expand Down
5 changes: 4 additions & 1 deletion electron/exposes/scrcpy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ const shell = async (command, { stdout, stderr } = {}) => {
const ADB = appStore.get('common.adbPath') || adbPath
const args = command.split(' ')

console.log('scrcpy.shell.spawnPath', spawnPath)
console.log('scrcpy.shell.ADB', ADB)

const scrcpyProcess = spawn(`"${spawnPath}"`, args, {
env: { ...process.env, ADB: `"${ADB}"` },
env: { ...process.env, ADB },
shell: true,
encoding: 'utf8',
})
Expand Down
9 changes: 5 additions & 4 deletions src/components/Preference/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
</template>

<script>
import { debounce } from 'lodash-es'
import { cloneDeep, debounce } from 'lodash-es'
import LanguageSelect from './LanguageSelect/index.vue'
import { usePreferenceStore } from '@/store/index.js'
import LoadingIcon from '@/components/Device/ControlBar/LoadingIcon/index.vue'
Expand Down Expand Up @@ -368,14 +368,15 @@ export default {
messageEl.close()
},
async handleSelect({ field }, { properties, filters } = {}) {
async handleSelect({ field }, options = {}) {
const { properties, filters } = cloneDeep(options)
try {
const defaultPath = this.preferenceData[field]
const files = await this.$electron.ipcRenderer.invoke(
'show-open-dialog',
{
properties,
filters,
properties: properties || [],
filters: filters || [],
...(defaultPath
? {
defaultPath,
Expand Down

0 comments on commit d815643

Please sign in to comment.