Skip to content

Commit dc8b572

Browse files
committed
feat(backButton): maintain compatibility with SSR
1 parent 98b916b commit dc8b572

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

ui/src/history.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isSSR } from './plugins/Platform.js'
1+
import { isSSR, client } from './plugins/Platform.js'
22
import { noop } from './utils/event.js'
33

44
const getTrue = () => true
@@ -8,10 +8,14 @@ export default {
88
add: noop,
99
remove: noop,
1010

11-
install ($q, cfg) {
12-
const { cordova, capacitor } = $q.platform.is
11+
install (cfg) {
12+
if (isSSR === true) {
13+
return
14+
}
15+
16+
const { cordova, capacitor } = client.is
1317

14-
if (isSSR === true || (cordova !== true && capacitor !== true)) {
18+
if (cordova !== true && capacitor !== true) {
1519
return
1620
}
1721

ui/src/install.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function (Vue, opts = {}) {
3131
Body.install(queues, cfg)
3232
Dark.install($q, queues, cfg)
3333
Screen.install($q, queues, cfg)
34-
History.install($q, cfg)
34+
History.install(cfg)
3535
Lang.install($q, queues, opts.lang)
3636
IconSet.install($q, opts.iconSet)
3737

0 commit comments

Comments
 (0)