fix primary name retrieval

This commit is contained in:
PhilReact 2025-05-31 10:07:48 +03:00
parent e910958b26
commit b5d3bbdc3f
5 changed files with 7 additions and 4 deletions

View File

@ -2,13 +2,15 @@ import { Box, Typography } from "@mui/material";
import { BarSpinner } from "./Spinners/BarSpinner/BarSpinner";
import { CSSProperties } from "react";
export type LoaderListStatus = "LOADING" | "NO_RESULTS"
interface ListLoaderProps {
isLoading: boolean;
loadingMessage?: string; // Optional message while loading
resultsLength: number;
noResultsMessage?: string; // Optional message when no results
children: React.ReactNode; // Required, to render the list content
loaderList?: (status: "LOADING" | "NO_RESULTS") => React.ReactNode; // Function type
loaderList?: (status: LoaderListStatus) => React.ReactNode; // Function type
loaderHeight?: CSSProperties
}

View File

@ -505,7 +505,7 @@ export const ListItemWrapper: React.FC<ListItemWrapperProps> = ({
// Example transformation (Modify item if needed)
const transformedItem = findCachedResource
? findCachedResource
: { qortalMetadata: item };
: { qortalMetadata: item, data: null };
return <>{render(transformedItem, index)}</>;
};

View File

@ -63,7 +63,7 @@ const setBalance = useAuthStore((s) => s.setBalance);
action: "GET_PRIMARY_NAME",
address: account.address,
});
setUser({ ...account, name: nameData?.name || "" });
setUser({ ...account, name: nameData || "" });
}
} catch (error) {
setErrorLoadingUser(

View File

@ -27,4 +27,5 @@ export {Resource} from './hooks/useResources'
export {Service, QortalGetMetadata} from './types/interfaces/resources'
export {ListItem} from './state/cache'
export {SymmetricKeys} from './utils/encryption'
export {LoaderListStatus} from './common/ListLoader'

View File

@ -32,7 +32,7 @@ export const mergeUniqueItems = (array1: QortalMetadata[], array2: QortalMetadat
};
export interface ListItem {
data?: any
data: any
qortalMetadata: QortalMetadata
}