@tailor-cms/tce-preview-runtime 0.4.0-beta.1 → 0.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/App.vue +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-cms/tce-preview-runtime",
3
- "version": "0.4.0-beta.1",
3
+ "version": "0.4.0-beta.2",
4
4
  "dependencies": {
5
5
  "@mdi/font": "7.2.96",
6
6
  "@vitejs/plugin-vue": "4.3.4",
package/src/App.vue CHANGED
@@ -8,7 +8,8 @@ import MainLayout from './components/MainLayout.vue';
8
8
  const appUrl = new URL(window.location.href);
9
9
  const apiPrefix = '/tce-server';
10
10
  const api = ky.create({ prefixUrl: apiPrefix });
11
- const ws = new WebSocket(`ws://${appUrl.host}${apiPrefix}`);
11
+ const wsProtocol = appUrl.protocol === 'http:' ? 'ws:' : 'wss:';
12
+ const ws = new WebSocket(`${wsProtocol}//${appUrl.host}${apiPrefix}`);
12
13
 
13
14
  const element = ref({});
14
15
  onMounted(async () => {