Skip to content

Commit

Permalink
fix: more minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Regikon committed Dec 20, 2024
1 parent bdee187 commit 01e6826
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/application/components/appliers_list/appliers_list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class AppliersList extends Component {
<div className="appliers-list__divider"></div>
<ol className="appliers-list__list">
{...appliersList}
{!appliersList || 'Пока никого нет'}
{appliersList && appliersList.length === 0 && 'Пока никого нет'}
</ol>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import * as vdom from '@/modules/vdom/virtual_dom';

export class LoadingScreen extends Component {
render() {
return <div class="loading-screen">Загружаем...</div>;
return <div class="loading-screen"></div>;
}
}
1 change: 1 addition & 0 deletions src/application/components/search_bar/search_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class SearchBar extends Component {
onFocusOut={this.props.onFocusOut}
onInput={this.props.onInput}
name="searchQuery"
autocomplete="off"
/>
</div>
);
Expand Down
9 changes: 1 addition & 8 deletions src/application/pages/profile_page/profile_page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,7 @@ export class ProfilePage extends Component {
}
this.isMyProfile = userData.id === this.userId && userData.userType === this.userType;
}
const profileData = profileStore.getData();
if (
(!profileData.profileLoaded ||
!profileData.userProfile ||
profileData.userProfile.id !== this.userId ||
profileData.userType !== this.userType) &&
!this.invokedLoadingProfile
) {
if (!this.invokedLoadingProfile) {
profileActionCreators.loadProfile(this.userType, this.userId);
this.invokedLoadingProfile = true;
} else {
Expand Down
5 changes: 3 additions & 2 deletions src/application/validators/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ export function validateRequired(value: string): FormValue {
}

export function validateNumeric(value: string): FormValue {
const isValid = /^\d+[\.\d]\d+$/.test(value);
let isValid = /^\d+$/.test(value);
isValid = isValid && parseInt(value, 10) > 0;
return {
value,
isValid,
errorMsg: isValid ? '' : 'Сюда нужно ввести число',
errorMsg: isValid ? '' : 'Сюда нужно ввести целое положительное число',
};
}

Expand Down

0 comments on commit 01e6826

Please sign in to comment.