v0.9.6 bug fixes
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
PROJECT_NAME=jama
|
||||
|
||||
# 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
|
||||
PORT=3000
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jama-backend",
|
||||
"version": "0.9.5",
|
||||
"version": "0.9.6",
|
||||
"description": "TeamChat backend server",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
|
||||
2
build.sh
2
build.sh
@@ -13,7 +13,7 @@
|
||||
# ─────────────────────────────────────────────────────────────
|
||||
set -euo pipefail
|
||||
|
||||
VERSION="${1:-0.9.5}"
|
||||
VERSION="${1:-0.9.6}"
|
||||
ACTION="${2:-}"
|
||||
REGISTRY="${REGISTRY:-}"
|
||||
IMAGE_NAME="jama"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jama-frontend",
|
||||
"version": "0.9.5",
|
||||
"version": "0.9.6",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -19,6 +19,7 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
|
||||
const [typing, setTyping] = useState([]);
|
||||
const [iconGroupInfo, setIconGroupInfo] = useState('');
|
||||
const [showInfo, setShowInfo] = useState(false);
|
||||
const [replyTo, setReplyTo] = useState(null);
|
||||
const [isMobile, setIsMobile] = useState(window.innerWidth < 768);
|
||||
|
||||
const messagesEndRef = useRef(null);
|
||||
@@ -143,10 +144,16 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
|
||||
}
|
||||
};
|
||||
|
||||
const handleSend = async ({ content, imageUrl, replyToId }) => {
|
||||
if ((!content?.trim() && !imageUrl) || !group) return;
|
||||
const handleSend = async ({ content, imageFile, linkPreview, emojiOnly }) => {
|
||||
if ((!content?.trim() && !imageFile) || !group) return;
|
||||
const replyToId = replyTo?.id || null;
|
||||
setReplyTo(null);
|
||||
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) {
|
||||
toast(e.message || 'Failed to send', 'error');
|
||||
}
|
||||
@@ -169,7 +176,7 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
|
||||
};
|
||||
|
||||
const handleReply = (msg) => {
|
||||
window.dispatchEvent(new CustomEvent('jama:reply', { detail: msg }));
|
||||
setReplyTo(msg);
|
||||
};
|
||||
|
||||
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);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="chat-window">
|
||||
{/* Header */}
|
||||
<div className="chat-header">
|
||||
@@ -292,8 +300,9 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
|
||||
This channel is read-only
|
||||
</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 && (
|
||||
<GroupInfoModal
|
||||
group={group}
|
||||
@@ -302,6 +311,6 @@ export default function ChatWindow({ group, onBack, onGroupUpdated, onDirectMess
|
||||
onBack={() => setShowInfo(false)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user