Skip to content

Commit 3e74cd0

Browse files
authored
fix: openItem errors (#1687)
1 parent b526407 commit 3e74cd0

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

src/common/notify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function notifyError ({ title, body = '' }) {
1616
title,
1717
body: `${body} ${i18n.t('clickToOpenLogs')}`.trim()
1818
}, () => {
19-
shell.openItem(app.getPath('userData'))
19+
shell.openPath(app.getPath('userData'))
2020
})
2121
}
2222

src/daemon/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ async function checkPortsArray (ipfsd, addrs) {
205205
})
206206

207207
if (opt === 0) {
208-
shell.openItem(join(ipfsd.path, 'config'))
208+
shell.openPath(join(ipfsd.path, 'config'))
209209
}
210210

211211
throw new Error('ports already being used')

src/dialogs/errors.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { app, shell } = require('electron')
2+
const path = require('path')
23
const i18n = require('i18next')
34
const dialog = require('./dialog')
45

@@ -20,6 +21,8 @@ ${e.stack}
2021

2122
let hasErrored = false
2223

24+
const newIssueUrl = (e) => `https://github.com/ipfs-shipyard/ipfs-desktop/issues/new?body=${encodeURI(issueTemplate(e))}`.substring(0, 1999)
25+
2326
function criticalErrorDialog (e) {
2427
if (hasErrored) return
2528
hasErrored = true
@@ -38,7 +41,7 @@ function criticalErrorDialog (e) {
3841
if (option === 0) {
3942
app.relaunch()
4043
} else if (option === 2) {
41-
shell.openExternal(`https://github.com/ipfs-shipyard/ipfs-desktop/issues/new?body=${encodeURI(issueTemplate(e))}`)
44+
shell.openExternal(newIssueUrl(e))
4245
}
4346

4447
app.exit(1)
@@ -72,9 +75,9 @@ function recoverableErrorDialog (e, options) {
7275
const option = dialog(cfg)
7376

7477
if (option === 1) {
75-
shell.openExternal(`https://github.com/ipfs-shipyard/ipfs-desktop/issues/new?body=${encodeURI(issueTemplate(e))}`)
78+
shell.openExternal(newIssueUrl(e))
7679
} else if (option === 2) {
77-
shell.openItem(app.getPath('userData'))
80+
shell.openPath(path.join(app.getPath('userData'), 'combined.log'))
7881
}
7982
}
8083

src/tray.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ function buildMenu (ctx) {
138138
submenu: [
139139
{
140140
label: i18n.t('openLogsDir'),
141-
click: () => { shell.openItem(app.getPath('userData')) }
141+
click: () => { shell.openPath(app.getPath('userData')) }
142142
},
143143
{
144144
label: i18n.t('openRepoDir'),
145-
click: () => { shell.openItem(store.get('ipfsConfig.path')) }
145+
click: () => { shell.openPath(store.get('ipfsConfig.path')) }
146146
},
147147
{
148148
label: i18n.t('openConfigFile'),
149-
click: () => { shell.openItem(store.path) }
149+
click: () => { shell.openPath(store.path) }
150150
},
151151
{ type: 'separator' },
152152
{
@@ -184,13 +184,13 @@ function buildMenu (ctx) {
184184
},
185185
{
186186
label: `ipfs-desktop ${VERSION}`,
187-
click: () => { shell.openExternal('https://github.com/ipfs-shipyard/ipfs-desktop/releases') }
187+
click: () => { shell.openExternal(`https://github.com/ipfs-shipyard/ipfs-desktop/releases/v${VERSION}`) }
188188
},
189189
{
190190
label: hasCustomBinary()
191191
? i18n.t('customIpfsBinary')
192192
: `go-ipfs ${GO_IPFS_VERSION}`,
193-
click: () => { shell.openExternal('https://github.com/ipfs/go-ipfs/releases') }
193+
click: () => { shell.openExternal(`https://github.com/ipfs/go-ipfs/releases/v${GO_IPFS_VERSION}`) }
194194
},
195195
{ type: 'separator' },
196196
{
@@ -204,7 +204,7 @@ function buildMenu (ctx) {
204204
},
205205
{
206206
label: i18n.t('helpUsTranslate'),
207-
click: () => { shell.openExternal('https://www.transifex.com/ipfs/ipfs-desktop/') }
207+
click: () => { shell.openExternal('https://www.transifex.com/ipfs/public/') }
208208
}
209209
]
210210
},

0 commit comments

Comments
 (0)