mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Add product name variable and fix bugs
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
export const API_BASE_URL: string = '/api';
|
||||
export const API_FULL_BASE_URL: string = "localhost:8301/api"
|
||||
export const API_FULL_BASE_URL: string = "localhost:8301/api";
|
||||
export const PRODUCT_NAME: string = "FromChat";
|
||||
@@ -1,6 +1,6 @@
|
||||
import './css/style.scss';
|
||||
import { showLogin, getAuthHeaders, authToken, currentUser } from './auth';
|
||||
import { API_BASE_URL, API_FULL_BASE_URL } from './config';
|
||||
import { API_BASE_URL, API_FULL_BASE_URL, PRODUCT_NAME } from './config';
|
||||
import type { Message, Messages, WebSocketMessage } from './types';
|
||||
import "./links";
|
||||
|
||||
@@ -120,6 +120,10 @@ export function sendMessage() {
|
||||
}
|
||||
|
||||
|
||||
// --------------
|
||||
// Initialization
|
||||
// --------------
|
||||
|
||||
websocket.addEventListener("message", (e) => {
|
||||
const message: WebSocketMessage = JSON.parse(e.data);
|
||||
switch (message.type) {
|
||||
@@ -136,4 +140,6 @@ showLogin();
|
||||
document.getElementById('message-form')!.addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
sendMessage();
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById("productname")!.textContent = PRODUCT_NAME;
|
||||
Reference in New Issue
Block a user