Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed extra loader from user tickets #604

Merged
merged 1 commit into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions frontend/app/src/people/utils/UserNoResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@ import React from 'react';
import { observer } from 'mobx-react-lite';
import { NoResultProps } from 'people/interfaces';
import { widgetConfigs } from './Constants';
import PageLoadSpinner from './PageLoadSpinner';
import NoneSpace from './NoneSpace';

function NoResults(props: NoResultProps) {
const tabs = widgetConfigs;

if (props.loading) {
return <PageLoadSpinner show={true} />;
} else {
return (
<NoneSpace
small
style={{
margin: 'auto',
marginTop: '25%'
}}
{...tabs['usertickets']?.noneSpace['noResult']}
/>
);
}
return (
<NoneSpace
small
style={{
margin: 'auto',
marginTop: '25%'
}}
{...tabs['usertickets']?.noneSpace['noResult']}
/>
);
}
export default observer(NoResults);
13 changes: 2 additions & 11 deletions frontend/app/src/people/widgetViews/UserTicketsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { BountyModal } from 'people/main/bountyModal/BountyModal';
import PageLoadSpinner from 'people/utils/PageLoadSpinner';
import history from '../../config/history';
import { colors } from '../../config/colors';
import { bountyHeaderFilter, bountyHeaderLanguageFilter } from '../utils/filterValidation';
import WantedView from './WantedView';
import DeleteTicketModal from './DeleteModal';

Expand Down Expand Up @@ -55,14 +54,6 @@ const UserTickets = () => {
checkboxIdToSelectedMap
};

const activeList = userTickets.filter((body: any) => {
const value = { ...body };
return (
bountyHeaderFilter(data.checkboxIdToSelectedMap, value?.paid, !!value?.assignee) &&
bountyHeaderLanguageFilter(value?.codingLanguage, {})
);
});

async function getUserTickets() {
setIsLoading(true);
const tickets = await main.getPersonAssignedWanteds({}, personPubkey);
Expand Down Expand Up @@ -109,8 +100,8 @@ const UserTickets = () => {
}, []);

const listItems =
activeList && activeList.length ? (
activeList.slice(0, currentItems).map((item: any, i: number) => {
userTickets && userTickets.length ? (
userTickets.slice(0, currentItems).map((item: any, i: number) => {
const person = main.people.find((p: any) => p.owner_pubkey === item.body.owner_id);
const body = { ...item.body };

Expand Down
2 changes: 0 additions & 2 deletions frontend/app/src/store/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,6 @@ export class MainStore {
}
}

this.setPersonWanteds(ps3);

return ps3;
} catch (e) {
console.log('fetch failed getPeopleWanteds: ', e);
Expand Down
Loading