Skip to content

Commit

Permalink
Inactive profile notify
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoom-Developer committed Nov 17, 2024
1 parent fc71253 commit f618b09
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
1 change: 0 additions & 1 deletion backend/src/application/user/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ async def register(self, userdata: dict, data: BaseUser, avatar: bytes) -> User:
return user

async def select_focus(self, user: User) -> User | None:
user.is_active = True
user.focus_user = None
user.focus_is_liked = False
focus = await self.repo.get_noviewed(user)
Expand Down
15 changes: 3 additions & 12 deletions frontend/src/pages/auth/ui/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,6 @@ export function Auth() {
console.log(blob)
setName((name) => name.trim())
setSurname((surname) => surname.trim())
// const userData: UserRegister = {
// name,
// surname,
// male: sex === Sex.MALE,
// desc,
// literal: literal ? literal : ''
// };
const userData = new FormData();
userData.append('avatar', blob)
userData.append('name', name)
Expand All @@ -166,13 +159,11 @@ export function Auth() {
type: "danger"
})
}
else {
addNotify({
addNotify({
title: 'Упс...',
content: statusCode,
content: ErrorsText[statusCode] ? ErrorsText[statusCode] : statusCode,
type: "danger"
})
}
})
}
})
})
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/feed/ui/feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ export function Feed({focus}: Props) {
if (!focus) {
return <main className={styles['main']} data-bg={"NO"}>
<div className={styles['not-load']}>
<Text className={styles['not-load-title']} color='hint' variant='body-3'>Анкеты для вас закончились 🐝</Text>
<Button onClick={updateUser} width='auto' size='l' className={styles['update-button']} view='normal'>Обновить<Icon data={ArrowRotateLeft}/></Button>
<Text className={styles['not-load-title']} color='hint' variant='body-3'>{user?.is_active ? 'Анкеты для вас закончились 🐝' : 'Ваша анкета неактивна, её активация доступна в профиле'}</Text>
{ user?.is_active && <Button onClick={updateUser} width='auto' size='l' className={styles['update-button']} view='normal'>Обновить<Icon data={ArrowRotateLeft}/></Button> }
</div>
</main>
} else if (user) return <main data-bg={bg ? "YES" : "NO"} className={styles['main']}>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/shared/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const Literales: Option[] = [

export const ErrorsText: Record<string, string> = {
"2000": "Вы уже зарегистрированы",
"2002": "Слишком большой размет фотографии",
"2001": "Аккаунт должен иметь юзернейм",
"2002": "Слишком большой размер фотографии",
"3000": "Вы не зарегистрированы",
"3004": "🐝 Бз-з, вы не подписаны на Подслушано 2107",
"3005": "Вы забанены",
Expand Down

0 comments on commit f618b09

Please sign in to comment.