(feat): improved conversation adding flow
All checks were successful
/ build-web (push) Successful in 1m8s
/ build-desktop (push) Successful in 11m11s
/ build-mobile (push) Successful in 15m40s
/ release (push) Successful in 21s

(feat): visual tweaks for user modal
(feat): now using full width for profile settings page on mobile
(fix): profile not saving with empty avatar
(chore): bump version due to prod release not getting created
(chore): update licenses
This commit is contained in:
Alois 2026-05-21 12:15:37 +02:00
commit ba59a49f98
14 changed files with 203 additions and 44 deletions

View file

@ -14,6 +14,7 @@ interface SessionContextType {
communities: Communities;
calls: Calls;
moveUserIdToTop: (userId: number) => void;
insertContact: (userId: number) => void;
}
const SessionContext = createContext<SessionContextType | undefined>(undefined);
@ -69,9 +70,31 @@ export default function SessionProvider({ children }: { children: ReactNode }) {
});
};
const insertContact = (userId: number) => {
setContacts((prevContacts) => {
if (prevContacts.some((contact) => contact.user_id === userId)) {
return prevContacts;
}
const newUser = {
user_id: userId,
last_message_at: new Date().getTime(),
messages: [],
} satisfies Contacts[0];
return [newUser, ...prevContacts];
});
};
return (
<SessionContext.Provider
value={{ contacts, communities, calls: freshCalls, moveUserIdToTop }}
value={{
contacts,
communities,
calls: freshCalls,
moveUserIdToTop,
insertContact,
}}
>
{children}
</SessionContext.Provider>