refactor: add formattedData in IConnection references
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
719a948134
commit
6a8ec97c31
@@ -42,7 +42,7 @@ function AppConnectionRow(props: AppConnectionRowProps): React.ReactElement {
|
||||
const [deleteConnection] = useMutation(DELETE_CONNECTION);
|
||||
|
||||
const formatMessage = useFormatMessage();
|
||||
const { id, key, data, verified, createdAt } = props.connection;
|
||||
const { id, key, formattedData, verified, createdAt } = props.connection;
|
||||
|
||||
const contextButtonRef = React.useRef<SVGSVGElement | null>(null);
|
||||
const [anchorEl, setAnchorEl] = React.useState<SVGSVGElement | null>(null);
|
||||
@@ -88,7 +88,7 @@ function AppConnectionRow(props: AppConnectionRowProps): React.ReactElement {
|
||||
spacing={1}
|
||||
>
|
||||
<Typography variant="h6">
|
||||
{data.screenName}
|
||||
{formattedData?.screenName}
|
||||
</Typography>
|
||||
|
||||
<Typography variant="caption">
|
||||
|
@@ -21,12 +21,12 @@ type ChooseAccountSubstepProps = {
|
||||
step: IStep;
|
||||
};
|
||||
|
||||
const optionGenerator = (connection: IConnection<IJSONObject>): { label: string; value: string; } => ({
|
||||
label: connection?.data?.screenName as string ?? 'Unnamed',
|
||||
const optionGenerator = (connection: IConnection): { label: string; value: string; } => ({
|
||||
label: connection?.formattedData?.screenName as string ?? 'Unnamed',
|
||||
value: connection?.id as string,
|
||||
});
|
||||
|
||||
const getOption = (options: Record<string, unknown>[], connectionId: string) => options.find(connection => connection.value === connectionId) || null;
|
||||
const getOption = (options: Record<string, unknown>[], connectionId?: string) => options.find(connection => connection.value === connectionId) || null;
|
||||
|
||||
function ChooseAccountSubstep(props: ChooseAccountSubstepProps): React.ReactElement {
|
||||
const {
|
||||
|
Reference in New Issue
Block a user