Improve user search, DB nulls, and chat UI
Change username filter to use icontains for partial/case-insensitive matching. In CustomUser.save, introduce _NULLABLE_CHAR_FIELDS and convert empty string char fields to None to ensure nullable fields are stored consistently. Update CreateChatModal to always show a subtitle combining the user's full name and account creation date (joined with " · "), improving UI information.
This commit is contained in:
@@ -292,13 +292,16 @@ export default function CreateChatModal({ open, onClose }: Props) {
|
||||
<div className="text-sm font-medium text-brand-text">
|
||||
{user.username}
|
||||
</div>
|
||||
{(user.first_name || user.last_name) && (
|
||||
<div className="truncate text-xs text-brand-text/50">
|
||||
{[user.first_name, user.last_name]
|
||||
.filter(Boolean)
|
||||
.join(" ")}
|
||||
</div>
|
||||
)}
|
||||
<div className="truncate text-xs text-brand-text/50">
|
||||
{[
|
||||
[user.first_name, user.last_name].filter(Boolean).join(" "),
|
||||
user.create_time
|
||||
? new Date(user.create_time).toLocaleDateString()
|
||||
: null,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" · ")}
|
||||
</div>
|
||||
</div>
|
||||
{selectedUsers.some((s) => s.id === user.id) && (
|
||||
<FiCheck size={14} className="shrink-0 text-brand-accent" />
|
||||
|
||||
Reference in New Issue
Block a user