|
@@ -38,7 +38,7 @@ export default function bridgeLoader(): DEV.Loader {
|
|
|
const scanned = config.image.el?.includes('scan');
|
|
const scanned = config.image.el?.includes('scan');
|
|
|
if (platformIsAIO_1()) window.bridge = new EventTarget() as InstanceType<typeof Bridge>;
|
|
if (platformIsAIO_1()) window.bridge = new EventTarget() as InstanceType<typeof Bridge>;
|
|
|
else if (platformIsAIO()) await waitFor(() => window.bridge != null);
|
|
else if (platformIsAIO()) await waitFor(() => window.bridge != null);
|
|
|
- window.bridge.addEventListener('scan', async ({ detail }) => {
|
|
|
|
|
|
|
+ window.bridge?.addEventListener('scan', async ({ detail }) => {
|
|
|
if (detail.code !== 0 || detail.data?.code == null) return;
|
|
if (detail.code !== 0 || detail.data?.code == null) return;
|
|
|
const route = unref(router.currentRoute);
|
|
const route = unref(router.currentRoute);
|
|
|
if (route.meta?.scan) {
|
|
if (route.meta?.scan) {
|