v0.9.6 bug fixes

This commit is contained in:
2026-03-14 00:49:05 -04:00
parent 11277c6167
commit 1fc50fdd6d
5 changed files with 19 additions and 10 deletions

View File

@@ -10,7 +10,7 @@
PROJECT_NAME=jama PROJECT_NAME=jama
# Image version to run (set by build.sh, or use 'latest') # Image version to run (set by build.sh, or use 'latest')
JAMA_VERSION=0.9.5 JAMA_VERSION=0.9.6
# App port — the host port Docker maps to the container # App port — the host port Docker maps to the container
PORT=3000 PORT=3000

View File

@@ -1,6 +1,6 @@
{ {
"name": "jama-backend", "name": "jama-backend",
"version": "0.9.5", "version": "0.9.6",
"description": "TeamChat backend server", "description": "TeamChat backend server",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {

View File

@@ -13,7 +13,7 @@
# ───────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────
set -euo pipefail set -euo pipefail
VERSION="${1:-0.9.5}" VERSION="${1:-0.9.6}"
ACTION="${2:-}" ACTION="${2:-}"
REGISTRY="${REGISTRY:-}" REGISTRY="${REGISTRY:-}"
IMAGE_NAME="jama" IMAGE_NAME="jama"

View File

@@ -1,6 +1,6 @@
{ {
"name": "jama-frontend", "name": "jama-frontend",
"version": "0.9.5", "version": "0.9.6",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@@ -19,6 +19,7 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
const [typing, setTyping] = useState([]); const [typing, setTyping] = useState([]);
const [iconGroupInfo, setIconGroupInfo] = useState(''); const [iconGroupInfo, setIconGroupInfo] = useState('');
const [showInfo, setShowInfo] = useState(false); const [showInfo, setShowInfo] = useState(false);
const [replyTo, setReplyTo] = useState(null);
const [isMobile, setIsMobile] = useState(window.innerWidth < 768); const [isMobile, setIsMobile] = useState(window.innerWidth < 768);
const messagesEndRef = useRef(null); const messagesEndRef = useRef(null);
@@ -143,10 +144,16 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
} }
}; };
const handleSend = async ({ content, imageUrl, replyToId }) => { const handleSend = async ({ content, imageFile, linkPreview, emojiOnly }) => {
if ((!content?.trim() && !imageUrl) || !group) return; if ((!content?.trim() && !imageFile) || !group) return;
const replyToId = replyTo?.id || null;
setReplyTo(null);
try { try {
await api.sendMessage({ groupId: group.id, content: content?.trim() || '', imageUrl, replyToId }); if (imageFile) {
await api.uploadImage(group.id, imageFile, { replyToId, content: content?.trim() || '' });
} else {
await api.sendMessage(group.id, { content: content.trim(), replyToId, linkPreview, emojiOnly });
}
} catch (e) { } catch (e) {
toast(e.message || 'Failed to send', 'error'); toast(e.message || 'Failed to send', 'error');
} }
@@ -169,7 +176,7 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
}; };
const handleReply = (msg) => { const handleReply = (msg) => {
window.dispatchEvent(new CustomEvent('jama:reply', { detail: msg })); setReplyTo(msg);
}; };
const handleDirectMessage = (dmGroup) => { const handleDirectMessage = (dmGroup) => {
@@ -199,6 +206,7 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
const isOnline = isDirect && group.peer_id && (onlineUserIds instanceof Set ? onlineUserIds.has(Number(group.peer_id)) : false); const isOnline = isDirect && group.peer_id && (onlineUserIds instanceof Set ? onlineUserIds.has(Number(group.peer_id)) : false);
return ( return (
<>
<div className="chat-window"> <div className="chat-window">
{/* Header */} {/* Header */}
<div className="chat-header"> <div className="chat-header">
@@ -292,8 +300,9 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
This channel is read-only This channel is read-only
</div> </div>
) : ( ) : (
<MessageInput group={group} currentUser={currentUser} onSend={handleSend} socket={socket} /> <MessageInput group={group} currentUser={currentUser} onSend={handleSend} socket={socket} replyTo={replyTo} onCancelReply={() => setReplyTo(null)} onTyping={() => {}} />
)} )}
</div>
{showInfo && ( {showInfo && (
<GroupInfoModal <GroupInfoModal
group={group} group={group}
@@ -302,6 +311,6 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
onBack={() => setShowInfo(false)} onBack={() => setShowInfo(false)}
/> />
)} )}
</div> </>
); );
} }