Skip to content

Commit

Permalink
Merge pull request #604 from stakwork/fix/user_tickets
Browse files Browse the repository at this point in the history
removed extra loader from user tickets
  • Loading branch information
elraphty authored Jul 24, 2023
2 parents 3800642 + 035b729 commit bb78959
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 28 deletions.
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

0 comments on commit bb78959

Please sign in to comment.