Skip to content

Commit

Permalink
catch empty message results
Browse files Browse the repository at this point in the history
  • Loading branch information
NickJ202 committed Jun 21, 2024
1 parent f893c15 commit ed00bb2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export async function messageResults(args: {
data: JSON.stringify(args.data),
});

await new Promise((resolve) => setTimeout(resolve, 500));
await new Promise((resolve) => setTimeout(resolve, 1000));

const messageResults = await results({
process: args.processId,
Expand Down
20 changes: 19 additions & 1 deletion src/api/profiles.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
import { readHandler } from 'api';

import { AOS } from 'helpers/config';
import { ProfileHeaderType, RegistryProfileType } from 'helpers/types';

export type AOProfileType = {
id: string;
walletAddress: string;
displayName: string | null;
username: string | null;
bio: string | null;
avatar: string | null;
banner: string | null;
};

export type ProfileHeaderType = AOProfileType;

export type RegistryProfileType = {
id: string;
avatar: string | null;
username: string;
bio?: string;
};

export async function getProfileById(args: { profileId: string }): Promise<ProfileHeaderType | null> {
const emptyProfile = {
Expand Down
3 changes: 1 addition & 2 deletions src/components/organisms/Banner/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import { fadeIn1, open } from 'helpers/animations';

export const Wrapper = styled.div`
height: 30px;
width 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
gap: 20px;
border-top: 1px solid ${(props) => props.theme.colors.border.alt2};
border-bottom: 1px solid ${(props) => props.theme.colors.border.alt2};
background: ${(props) => props.theme.colors.container.alt6.background};
animation: ${open} ${fadeIn1};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ export default function AssetActionMarketOrders(props: IProps) {
setOrderLoading(true);
try {
setCurrentNotification('Depositing balance...');

const response: any = await messageResults({
processId: arProvider.profile.id,
action: 'Transfer',
Expand All @@ -256,7 +255,8 @@ export default function AssetActionMarketOrders(props: IProps) {
});

if (response) {
setCurrentNotification(response['Transfer-Success'].message || 'Deposited funds');
if (response['Transfer-Success'])
setCurrentNotification(response['Transfer-Success'].message || 'Deposited funds');
switch (props.type) {
case 'buy':
case 'sell':
Expand Down

0 comments on commit ed00bb2

Please sign in to comment.