@electerm/electerm-react 1.37.28 → 1.37.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/common/resolve.js
CHANGED
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export default (basePath, nameOrDot) => {
|
|
9
|
-
const sep = basePath.includes('\\') ||
|
|
9
|
+
const sep = (basePath.includes('\\') ||
|
|
10
|
+
basePath.includes(':\\') ||
|
|
11
|
+
/^[a-z]+:$/i.test(basePath) ||
|
|
12
|
+
/^[a-z]+:$/i.test(nameOrDot)
|
|
13
|
+
)
|
|
10
14
|
? '\\'
|
|
11
15
|
: '/'
|
|
12
16
|
if (nameOrDot === '..') {
|
|
@@ -18,12 +22,15 @@ export default (basePath, nameOrDot) => {
|
|
|
18
22
|
const res = arr.slice(0, length - 1).join(sep)
|
|
19
23
|
return res || '/'
|
|
20
24
|
}
|
|
21
|
-
const pre = nameOrDot.includes(':\\') && basePath === '/'
|
|
25
|
+
const pre = (nameOrDot.includes(':\\') || /^[a-z]+:$/i.test(nameOrDot)) && basePath === '/'
|
|
22
26
|
? ''
|
|
23
27
|
: basePath
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
const mid = (basePath.endsWith(sep) ? '' : sep)
|
|
29
|
+
let ff = pre + mid + nameOrDot
|
|
30
|
+
if (/^\\[a-z]+:$/i.test(ff)) {
|
|
31
|
+
ff = ff.slice(1)
|
|
32
|
+
}
|
|
33
|
+
return ff
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
export const osResolve = (...args) => {
|
|
@@ -60,7 +60,7 @@ export default class Upgrade extends PureComponent {
|
|
|
60
60
|
showCount: old.showCount + 1
|
|
61
61
|
}
|
|
62
62
|
})
|
|
63
|
-
this.getLatestRelease(
|
|
63
|
+
this.getLatestRelease(e.data.noSkip)
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -90,7 +90,7 @@ export default class Upgrade extends PureComponent {
|
|
|
90
90
|
clearTimeout(this.downloadTimer)
|
|
91
91
|
if (upgradePercent >= 100) {
|
|
92
92
|
this.update && this.update.destroy()
|
|
93
|
-
return this.
|
|
93
|
+
return this.handleClose()
|
|
94
94
|
}
|
|
95
95
|
this.changeProps({
|
|
96
96
|
upgradePercent
|
|
@@ -126,7 +126,7 @@ export default class Upgrade extends PureComponent {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
onEnd = () => {
|
|
129
|
-
this.
|
|
129
|
+
this.handleClose()
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
doUpgrade = async () => {
|
|
@@ -154,8 +154,10 @@ export default class Upgrade extends PureComponent {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
handleSkipVersion = () => {
|
|
157
|
-
window.store.
|
|
158
|
-
|
|
157
|
+
window.store.setConfig({
|
|
158
|
+
skipVersion: this.props.upgradeInfo.remoteVersion
|
|
159
|
+
})
|
|
160
|
+
this.handleClose()
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
getLatestRelease = async (noSkipVersion = false) => {
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import { commonActions } from '../common/constants'
|
|
6
6
|
|
|
7
7
|
export default Store => {
|
|
8
|
-
Store.prototype.onCheckUpdate = () => {
|
|
8
|
+
Store.prototype.onCheckUpdate = (noSkip = true) => {
|
|
9
9
|
window.postMessage({
|
|
10
|
-
action: commonActions.appUpdateCheck
|
|
10
|
+
action: commonActions.appUpdateCheck,
|
|
11
|
+
noSkip
|
|
11
12
|
}, '*')
|
|
12
13
|
}
|
|
13
14
|
Store.prototype.getProxySetting = function () {
|
|
@@ -185,7 +185,7 @@ export default (Store) => {
|
|
|
185
185
|
}
|
|
186
186
|
store.initCommandLine().catch(store.onError)
|
|
187
187
|
if (store.config.checkUpdateOnStart) {
|
|
188
|
-
store.onCheckUpdate()
|
|
188
|
+
store.onCheckUpdate(false)
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
Store.prototype.initCommandLine = async function () {
|