Skip to content

Commit dd3ad6c

Browse files
committed
perf: 🔍️ Optimize QR code style to avoid scanning problems on some devices
1 parent 9420947 commit dd3ad6c

File tree

2 files changed

+17
-6
lines changed
  • src
    • pages/device/components/WirelessGroup/QrAction
    • utils/device/generateAdbPairingQR

2 files changed

+17
-6
lines changed

src/pages/device/components/WirelessGroup/QrAction/index.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
placement="top"
55
:width="200"
66
trigger="click"
7-
popper-class=""
7+
popper-class="el-popover--scanner"
88
@hide="onHide"
99
>
1010
<template #reference>
@@ -72,4 +72,10 @@ function onHide() {
7272
}
7373
</script>
7474

75-
<style></style>
75+
<style lang="postcss">
76+
.dark .el-popover--scanner {
77+
&, .el-popper__arrow::before {
78+
@apply !bg-primary-500;
79+
}
80+
}
81+
</style>

src/utils/device/generateAdbPairingQR/index.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ export async function generateAdbPairingQR(options = {}) {
2323
const dataUrl = await qrCode.toDataURL(pairingText, {
2424
type: 'image/webp',
2525
rendererOpts: { quality: 1 },
26-
color: {
27-
dark: primaryColor,
28-
light: themeStore.isDark ? '#1d1e1f' : '#ffffff',
29-
},
26+
color: themeStore.isDark
27+
? {
28+
dark: '#000000',
29+
light: primaryColor,
30+
}
31+
: {
32+
dark: primaryColor,
33+
light: '#ffffff',
34+
},
3035
margin: 0,
3136
})
3237

0 commit comments

Comments
 (0)