v0.6.7 updated message display name handling

This commit is contained in:
2026-03-10 20:08:44 -04:00
parent 741cf5390f
commit 9da2f64f5e
5 changed files with 20 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ TZ=UTC
# Copy this file to .env and customize # Copy this file to .env and customize
# 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.6.6 JAMA_VERSION=0.6.7
# Default admin credentials (used on FIRST RUN only) # Default admin credentials (used on FIRST RUN only)
ADMIN_NAME=Admin User ADMIN_NAME=Admin User

View File

@@ -1,6 +1,6 @@
{ {
"name": "jama-backend", "name": "jama-backend",
"version": "0.6.6", "version": "0.6.7",
"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.6.6}" VERSION="${1:-0.6.7}"
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.6.6", "version": "0.6.7",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View File

@@ -13,6 +13,7 @@ export default function GroupInfoModal({ group, onClose, onUpdated, onBack }) {
const [addSearch, setAddSearch] = useState(''); const [addSearch, setAddSearch] = useState('');
const [addResults, setAddResults] = useState([]); const [addResults, setAddResults] = useState([]);
const [customName, setCustomName] = useState(group.owner_name_original ? group.name : ''); const [customName, setCustomName] = useState(group.owner_name_original ? group.name : '');
const [savedCustomName, setSavedCustomName] = useState(group.owner_name_original ? group.name : '');
const [savingCustom, setSavingCustom] = useState(false); const [savingCustom, setSavingCustom] = useState(false);
const isDirect = !!group.is_direct; const isDirect = !!group.is_direct;
@@ -30,8 +31,10 @@ export default function GroupInfoModal({ group, onClose, onUpdated, onBack }) {
const handleCustomName = async () => { const handleCustomName = async () => {
setSavingCustom(true); setSavingCustom(true);
try { try {
await api.setCustomGroupName(group.id, customName.trim()); const saved = customName.trim();
toast(customName.trim() ? 'Custom name saved' : 'Custom name removed', 'success'); await api.setCustomGroupName(group.id, saved);
setSavedCustomName(saved);
toast(saved ? 'Custom name saved' : 'Custom name removed', 'success');
onUpdated(); onUpdated();
} catch (e) { } catch (e) {
toast(e.message, 'error'); toast(e.message, 'error');
@@ -165,9 +168,17 @@ export default function GroupInfoModal({ group, onClose, onUpdated, onBack }) {
placeholder={group.owner_name_original || group.name} placeholder={group.owner_name_original || group.name}
onKeyDown={e => e.key === 'Enter' && handleCustomName()} onKeyDown={e => e.key === 'Enter' && handleCustomName()}
/> />
<button className="btn btn-primary btn-sm" onClick={handleCustomName} disabled={savingCustom}> {customName.trim() !== savedCustomName ? (
{customName.trim() ? 'Save' : 'Remove'} <button className="btn btn-primary btn-sm" onClick={handleCustomName} disabled={savingCustom}>
</button> Save
</button>
) : savedCustomName ? (
<button className="btn btn-sm" style={{ background: 'var(--surface-variant)', color: 'var(--text-secondary)' }}
onClick={() => { setCustomName(''); }}
disabled={savingCustom}>
Remove
</button>
) : null}
</div> </div>
{group.owner_name_original && ( {group.owner_name_original && (
<p className="text-xs" style={{ color: 'var(--text-tertiary)', marginTop: 4 }}> <p className="text-xs" style={{ color: 'var(--text-tertiary)', marginTop: 4 }}>