diff --git a/packages/frontend/package-lock.json b/packages/frontend/package-lock.json index 3dd2d89..650ceaf 100644 --- a/packages/frontend/package-lock.json +++ b/packages/frontend/package-lock.json @@ -8,7 +8,7 @@ "name": "@desktop/frontend", "version": "0.0.1", "dependencies": { - "@bytetrade/ui": "^0.1.28", + "@bytetrade/ui": "^0.1.29", "@quasar/extras": "^1.16.7", "@types/ua-parser-js": "0.7.36", "axios": "^0.21.1", @@ -2015,9 +2015,9 @@ } }, "node_modules/@bytetrade/ui": { - "version": "0.1.28", - "resolved": "https://registry.npmjs.org/@bytetrade/ui/-/ui-0.1.28.tgz", - "integrity": "sha512-jQZ69MjFhP5lWdk5Ol/1J6eAeSQh5ICku3uHbon1J1xJS0WmXa3ijaCn3R3IrV7eRyNCCJHHO67ca5OH6GOMBw==", + "version": "0.1.29", + "resolved": "https://registry.npmjs.org/@bytetrade/ui/-/ui-0.1.29.tgz", + "integrity": "sha512-Ktu24w0ATJTFXFX03tzpLDCVK+WRiy2p3pSiQcqy9NPmPTRNviDFu0+hiOEGg4HYAHxAV939LtOKHzq6HyDVzA==", "dependencies": { "@quasar/extras": "^1.16.7", "axios": "^1.3.4", @@ -15921,9 +15921,9 @@ } }, "@bytetrade/ui": { - "version": "0.1.28", - "resolved": "https://registry.npmjs.org/@bytetrade/ui/-/ui-0.1.28.tgz", - "integrity": "sha512-jQZ69MjFhP5lWdk5Ol/1J6eAeSQh5ICku3uHbon1J1xJS0WmXa3ijaCn3R3IrV7eRyNCCJHHO67ca5OH6GOMBw==", + "version": "0.1.29", + "resolved": "https://registry.npmjs.org/@bytetrade/ui/-/ui-0.1.29.tgz", + "integrity": "sha512-Ktu24w0ATJTFXFX03tzpLDCVK+WRiy2p3pSiQcqy9NPmPTRNviDFu0+hiOEGg4HYAHxAV939LtOKHzq6HyDVzA==", "requires": { "@quasar/extras": "^1.16.7", "axios": "^1.3.4", diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 5a17565..60e38ac 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -13,7 +13,7 @@ "build": "quasar build -m pwa" }, "dependencies": { - "@bytetrade/ui": "^0.1.28", + "@bytetrade/ui": "^0.1.29", "@desktop/core": "0.1.0", "@quasar/extras": "^1.16.7", "@types/ua-parser-js": "0.7.36", diff --git a/packages/frontend/src/components/BasicWindow.vue b/packages/frontend/src/components/BasicWindow.vue index 4fdd763..d606a8f 100644 --- a/packages/frontend/src/components/BasicWindow.vue +++ b/packages/frontend/src/components/BasicWindow.vue @@ -266,18 +266,25 @@ export default defineComponent({ } }; - // const message = (event: any) => { - // if (event.data.message === 'theme_update') { - // if (event.data.info.theme.toString() === '1') { - // $q.dark.set(false); - // } else { - // $q.dark.set(true); - // } - // } - // }; + const message = (event: any) => { + if (event.data.message === 'theme_update') { + if (event.data.info.theme.toString() === '1') { + $q.dark.set(false); + } else { + $q.dark.set(true); + } + iframeRef.value.contentWindow.postMessage( + { + message: 'theme_apps_update', + info: event.data.info + }, + '*' + ); + } + }; onMounted(() => { - // window.addEventListener('message', message); + window.addEventListener('message', message); nextTick(() => { new MutationObserver(function (mutations) { @@ -316,7 +323,7 @@ export default defineComponent({ }); onUnmounted(() => { - // window.removeEventListener('message', message); + window.removeEventListener('message', message); }); return {