Рабочий чат
This commit is contained in:
@@ -178,6 +178,7 @@ export interface FriendRequest {
|
||||
id: string;
|
||||
user: User;
|
||||
createdAt: string;
|
||||
isOutgoing?: boolean;
|
||||
}
|
||||
|
||||
export interface FriendWithId extends UserPresence {
|
||||
|
||||
@@ -43,8 +43,10 @@ export class HttpClient {
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({}));
|
||||
const errorMessage = errorData.error || errorData.message || 'Ошибка запроса';
|
||||
throw new Error(errorMessage);
|
||||
const errorMessage = errorData.error || errorData.message || `Request failed with status ${response.status}`;
|
||||
const err = new Error(errorMessage);
|
||||
(err as any).status = response.status;
|
||||
throw err;
|
||||
}
|
||||
|
||||
// Handle empty responses (e.g., 200 OK with no body)
|
||||
|
||||
@@ -136,6 +136,8 @@ const translations = {
|
||||
stories: 'Истории',
|
||||
clearChat: 'Очистить чат',
|
||||
clearChatConfirm: 'Очистить историю чата для себя? Собеседник сохранит свою историю.',
|
||||
clearHistory: 'Очистить историю',
|
||||
clearHistoryConfirm: 'Очистить историю?',
|
||||
deleteChatConfirm: 'Удалить чат? Это действие нельзя отменить.',
|
||||
pinChat: 'Закрепить чат',
|
||||
unpinChat: 'Открепить чат',
|
||||
@@ -257,8 +259,11 @@ const translations = {
|
||||
removeFriend: 'Удалить из контактов',
|
||||
requestSent: 'Заявка отправлена',
|
||||
searchFriends: 'Поиск по @username (мин. 3 символа)',
|
||||
searchResults: 'Результаты поиска',
|
||||
noSearchResults: 'Пользователи не найдены',
|
||||
minCharsHint: 'Введите минимум 3 символа после @',
|
||||
selectContactToChat: 'Выберите контакт из списка, чтобы начать общение, или воспользуйтесь поиском для поиска новых людей.',
|
||||
backToChats: 'Назад к чатам',
|
||||
// Story viewers
|
||||
storyViewers: 'Кто просмотрел',
|
||||
noViewers: 'Пока никто не посмотрел',
|
||||
@@ -412,6 +417,8 @@ const translations = {
|
||||
stories: 'Stories',
|
||||
clearChat: 'Clear chat',
|
||||
clearChatConfirm: 'Clear chat history for yourself? The other person will keep their history.',
|
||||
clearHistory: 'Clear history',
|
||||
clearHistoryConfirm: 'Clear history?',
|
||||
deleteChatConfirm: 'Delete this chat? This action cannot be undone.',
|
||||
pinChat: 'Pin chat',
|
||||
unpinChat: 'Unpin chat',
|
||||
@@ -522,8 +529,11 @@ const translations = {
|
||||
removeFriend: 'Remove from contacts',
|
||||
requestSent: 'Request sent',
|
||||
searchFriends: 'Search by @username (min. 3 chars)',
|
||||
searchResults: 'Search Results',
|
||||
noSearchResults: 'No users found',
|
||||
minCharsHint: 'Enter at least 3 characters after @',
|
||||
selectContactToChat: 'Select a contact from the list to start a conversation or use search to find new people.',
|
||||
backToChats: 'Back to Chats',
|
||||
storyViewers: 'Who viewed',
|
||||
noViewers: 'No one viewed yet',
|
||||
replyToStory: 'Reply to story...',
|
||||
|
||||
@@ -12,9 +12,7 @@ export default function GlobalNavBar({ activeTab, onTabChange }: GlobalNavBarPro
|
||||
|
||||
const menuItems = [
|
||||
{ id: 'chats', icon: 'chat', label: t('chats') },
|
||||
{ id: 'calls', icon: 'call', label: t('calls') },
|
||||
{ id: 'contacts', icon: 'contacts', label: t('contacts') },
|
||||
{ id: 'archive', icon: 'archive', label: t('archive') },
|
||||
{ id: 'settings', icon: 'settings', label: t('settings') },
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user