Skip to content

Commit

Permalink
fix: 🐛 修复 macOS 或 linux 下自定义依赖选项描述错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Oct 21, 2023
1 parent 48dfdcc commit 0d4b1ce
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
out
.gitignore
dist
dist-electron
dist-release
16 changes: 12 additions & 4 deletions src/components/Preference/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ export default {
}
catch (error) {
if (error.message) {
this.$message.warning(error.message)
const message = error.message?.match(/Error: (.*)/)?.[1]
this.$message.warning(message || error.message)
}
}
},
Expand All @@ -309,20 +310,26 @@ export default {
}
catch (error) {
if (error.message) {
this.$message.warning(error.message)
const message = error.message?.match(/Error: (.*)/)?.[1]
this.$message.warning(message || error.message)
}
}
messageEl.close()
},
async handleSelect({ field }, { properties, filters } = {}) {
try {
const defaultPath = this.scrcpyForm[field]
const files = await this.$electron.ipcRenderer.invoke(
'show-open-dialog',
{
properties,
filters,
defaultPath: this.scrcpyForm[field],
...(defaultPath
? {
defaultPath,
}
: {}),
},
)
Expand All @@ -332,7 +339,8 @@ export default {
}
catch (error) {
if (error.message) {
this.$message.warning(error.message)
const message = error.message?.match(/Error: (.*)/)?.[1]
this.$message.warning(message || error.message)
}
}
},
Expand Down
16 changes: 8 additions & 8 deletions src/store/scrcpy/model/custom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ export default () => {
properties: ['openDirectory'],
},
{
label: 'Adb 路径',
label: 'adb 路径',
field: 'adbPath',
type: 'input.path',
value: adbPath,
tips: '用于连接设备的 adb.exe 的地址,注意:该选项不受针对于单个设备配置的影响',
placeholder: '请选择 Adb.exe',
tips: '用于连接设备的 adb 的地址,注意:该选项不受针对于单个设备配置的影响',
placeholder: '请选择 adb',
properties: ['openFile'],
filters: [{ name: '请选择 Adb.exe', extensions: ['exe'] }],
filters: [{ name: '请选择 adb', extensions: ['*'] }],
},
{
label: 'Scrcpy 路径',
label: 'scrcpy 路径',
field: 'scrcpyPath',
type: 'input.path',
value: scrcpyPath,
tips: '用于控制设备的 Scrcpy.exe 的地址,注意:该选项不受针对于单个设备配置的影响',
placeholder: '请选择 Scrcpy.exe',
tips: '用于控制设备的 scrcpy 的地址,注意:该选项不受针对于单个设备配置的影响',
placeholder: '请选择 scrcpy',
properties: ['openFile'],
filters: [{ name: '请选择 Scrcpy.exe', extensions: ['exe'] }],
filters: [{ name: '请选择 scrcpy', extensions: ['*'] }],
},
]
}

0 comments on commit 0d4b1ce

Please sign in to comment.