diff --git a/web/.env.production b/web/.env.production new file mode 100644 index 0000000..6e03fa8 --- /dev/null +++ b/web/.env.production @@ -0,0 +1 @@ +VITE_APP_CHAT_REBOOT_ENDPOINT=https://a442idxkzz7.prod1.rbt.cloud:9991 diff --git a/web/.firebase/hosting.ZGlzdA.cache b/web/.firebase/hosting.ZGlzdA.cache new file mode 100644 index 0000000..b477209 --- /dev/null +++ b/web/.firebase/hosting.ZGlzdA.cache @@ -0,0 +1,4 @@ +vite.svg,1755049636484,9de4d3c4e50257d9874f07e9efc929efefc85e51f931a9af716f9a7ebb23ef68 +index.html,1755049636969,3ce04dd71a68b39accfb18c6e82e3c56717f7cddbad5398694233579c6c75849 +assets/index-Bkjp3jnN.css,1755049636968,88f3bc76faf694807abe7b1b424a6dcd7261f7376c6cebc2c34515cac4f34461 +assets/index-CLioFiBL.js,1755049636969,07a71d7a25cc42ba4207edf6b50b24964b20985a92da6a89cac39ff37077e003 diff --git a/web/.firebaserc b/web/.firebaserc new file mode 100644 index 0000000..0d452b4 --- /dev/null +++ b/web/.firebaserc @@ -0,0 +1,5 @@ +{ + "projects": { + "default": "chat-reboot-dev-web" + } +} diff --git a/web/firebase.json b/web/firebase.json new file mode 100644 index 0000000..2c33c29 --- /dev/null +++ b/web/firebase.json @@ -0,0 +1,16 @@ +{ + "hosting": { + "public": "dist", + "ignore": [ + "firebase.json", + "**/.*", + "**/node_modules/**" + ], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } + ] + } +} diff --git a/web/src/App.tsx b/web/src/App.tsx index b288516..fb90d82 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -108,9 +108,7 @@ const PendingChatbotMessage: FC<{ chatbotId: string; index: number }> = ({ )); }; -const PendingChatbotMessages: FC<{ username: string }> = ({ - username, -}) => { +const PendingChatbotMessages: FC<{ username: string }> = ({ username }) => { const { useListChatbots } = useUser({ id: username }); const { response } = useListChatbots(); @@ -211,6 +209,7 @@ const LoggedInChatApp: FC<{ username: string; handleLogout: () => void }> = ({ reactions={{}} pending={true} key={message.idempotencyKey} + timestamp={new Date().toLocaleString()} /> ))} {Object.keys(messages) diff --git a/web/src/ChatMessage.tsx b/web/src/ChatMessage.tsx index ee995c4..56ae02d 100644 --- a/web/src/ChatMessage.tsx +++ b/web/src/ChatMessage.tsx @@ -87,7 +87,7 @@ const ChatMessage: FC<{ .sort((left, right) => { return left[0].localeCompare(right[0]); }) - .map(([reaction, { users }]) => ( + .map(([reaction, { users }]: any) => ( { const ReactionsWindow: FC<{}> = () => { const username = localStorage.getItem("username"); + if (username === null) { + throw new Error("Username not found in localStorage"); + } + const [limit, setLimit] = useState(40); const { useMessagesReactions } = useUser({ id: username }); diff --git a/web/src/main.tsx b/web/src/main.tsx index 113e789..a9a5353 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -5,9 +5,12 @@ import ReactDOM from "react-dom/client"; import App from "./App.tsx"; import "./index.css"; +const url = + import.meta.env.VITE_APP_CHAT_REBOOT_ENDPOINT || "http://localhost:9991"; + ReactDOM.createRoot(document.getElementById("root")!).render( - +