fix: inject app version from package.json instead of hardcoded 1.0.0
- Add Vite define for __APP_VERSION__ from package.json - Use dynamic version in gateway connect handshake and userAgent - Show version number in sidebar footer - Add globals.d.ts type declaration
This commit is contained in:
@@ -98,7 +98,7 @@ export class GatewayClient {
|
||||
this.request(id, 'connect', {
|
||||
minProtocol: 3,
|
||||
maxProtocol: 3,
|
||||
client: { id: 'webchat', version: '1.0.0', platform: 'web', mode: 'webchat' },
|
||||
client: { id: 'webchat', version: __APP_VERSION__, platform: 'web', mode: 'webchat' },
|
||||
role: 'operator',
|
||||
scopes: ['operator.read', 'operator.write'],
|
||||
caps: [],
|
||||
@@ -106,7 +106,7 @@ export class GatewayClient {
|
||||
permissions: {},
|
||||
auth: { token: this.authToken },
|
||||
locale: navigator.language || 'en',
|
||||
userAgent: 'pinchchat/1.0.0',
|
||||
userAgent: `pinchchat/${__APP_VERSION__}`,
|
||||
}).then((res) => {
|
||||
console.log('[GW] connected!', res);
|
||||
this.connected = true;
|
||||
|
||||
Reference in New Issue
Block a user