This repository was archived by the owner on Dec 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +17
-6
lines changed
Expand file tree Collapse file tree 5 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ function handleRoute() {
2828 const params = new URLSearchParams (route .hash .slice (1 ));
2929 const token = params .get (" token" );
3030
31- let is7TV;
31+ let is7TV: boolean ;
3232 try {
3333 is7TV = opener .location .origin === window .origin ;
3434 } catch (e ) {
Original file line number Diff line number Diff line change @@ -28,10 +28,16 @@ export class EventAPI {
2828 connect ( transport : EventAPITransport ) : void {
2929 if ( this . eventSource || this . socket || ! this . url ) return ;
3030
31+ const url = new URL ( this . url ) ;
32+
33+ // Add query param giving the version of the website / src
34+ url . searchParams . append ( "app" , "7tv-website-old" ) ;
35+ url . searchParams . append ( "version" , import . meta. env . VITE_APP_VERSION ) ;
36+
3137 this . transport = transport ;
3238
3339 if ( this . transport === "WebSocket" ) {
34- this . socket = new WebSocket ( this . url ) ;
40+ this . socket = new WebSocket ( url ) ;
3541 this . socket . onopen = ( ) => this . onOpen ( ) ;
3642 this . socket . onclose = ( ) => this . onClose ( ) ;
3743 this . socket . onmessage = ( ev ) => {
@@ -44,7 +50,7 @@ export class EventAPI {
4450 } ;
4551 }
4652
47- log . debug ( "<EventAPI>" , "Connecting..." , `url=${ this . url } ` ) ;
53+ log . debug ( "<EventAPI>" , "Connecting..." , `url=${ url } ` ) ;
4854 }
4955
5056 getSocket ( ) : WebSocket | null {
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ export function handleMessage<N extends WorkerMessageName>(evt: WorkerMessage<N>
1111 switch ( evt . name ) {
1212 case "EventCommandSubscribe" : {
1313 const d = evt . data as WorkerMessageData < "EventCommandSubscribe" > ;
14-
1514 eventAPI . subscribe ( d . type , d . condition ) ;
1615 break ;
1716 }
Original file line number Diff line number Diff line change 22 "compilerOptions" : {
33 "composite" : true ,
44 "module" : " esnext" ,
5- "moduleResolution" : " node"
5+ "moduleResolution" : " node" ,
6+ "resolveJsonModule" : true
67 },
78 "include" : [" vite.config.ts" ]
89}
Original file line number Diff line number Diff line change 1+ import { version } from "./package.json" ;
12import vue from "@vitejs/plugin-vue" ;
23import { resolve } from "path" ;
34import { visualizer } from "rollup-plugin-visualizer" ;
45import { defineConfig , loadEnv } from "vite" ;
56
67// https://vitejs.dev/config/
78export default ( { mode } ) => {
8- process . env = { ...process . env , ...loadEnv ( mode , process . cwd ( ) ) } ;
9+ process . env = {
10+ ...process . env ,
11+ ...loadEnv ( mode , process . cwd ( ) ) ,
12+ VITE_APP_VERSION : version ,
13+ } ;
914
1015 return defineConfig ( {
1116 build : {
You can’t perform that action at this time.
0 commit comments