We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd26c04 commit 695cdceCopy full SHA for 695cdce
src/runtime/plugins/detect.server.ts
@@ -50,13 +50,19 @@ export default defineNuxtPlugin({
50
})
51
}
52
// detect browser info
53
- state.value.browserInfo = JSON.parse(JSON.stringify(await asyncDetect({
+ const browserInfo = await asyncDetect({
54
hints,
55
httpHeaders: requestHeaders,
56
- })))
+ })
57
+ if (browserInfo) {
58
+ state.value.browserInfo = JSON.parse(JSON.stringify(browserInfo))
59
+ }
60
61
else if (userAgentHeader) {
- state.value.browserInfo = JSON.parse(JSON.stringify(detect(userAgentHeader)))
62
+ const browserInfo = detect(userAgentHeader)
63
64
65
66
67
68
return {
0 commit comments