mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 15:36:18 +00:00
Last-mile typecheck sweep: 3 small bugs
- GuideToolOngoingView classNames clause: classNames(..., 'chat.roomId'
&& 'cursor-pointer') — the property name was quoted so the literal
string 'chat.roomId' was always-truthy. Unquote to read the actual
chat.roomId field.
- NavigatorRoomSettingsModTabView: UserProfileIconView userName={ user.userId }
put a number into the string-typed userName prop; the right prop for
a numeric id is userId.
- WiredExtraVariableEchoView resolvedVariableEntries: the inline
fallback-entry literal at the bottom of the useMemo got its kind
field widened to string (instead of the 'custom' literal needed by
IWiredVariablePickerEntry). Lift it into a typed const + rename to
namedFallback to avoid the shadowing of the upstream
createFallbackVariableEntry result.
This commit is contained in:
@@ -101,7 +101,7 @@ export const GuideToolOngoingView: FC<GuideToolOngoingViewProps> = props =>
|
|||||||
{ (isOwnChat(group.userId)) && GetSessionDataManager().userName }
|
{ (isOwnChat(group.userId)) && GetSessionDataManager().userName }
|
||||||
{ (!isOwnChat(group.userId)) && userName }
|
{ (!isOwnChat(group.userId)) && userName }
|
||||||
</Text>
|
</Text>
|
||||||
{ group.messages.map((chat, index) => <div key={ index } className={ classNames(chat.roomId ? 'text-break text-underline' : 'text-break', 'chat.roomId' && 'cursor-pointer') } onClick={ () => chat.roomId ? TryVisitRoom(chat.roomId) : null }>{ chat.message }</div>) }
|
{ group.messages.map((chat, index) => <div key={ index } className={ classNames(chat.roomId ? 'text-break text-underline' : 'text-break', chat.roomId && 'cursor-pointer') } onClick={ () => chat.roomId ? TryVisitRoom(chat.roomId) : null }>{ chat.message }</div>) }
|
||||||
</div>
|
</div>
|
||||||
{ (isOwnChat(group.userId)) &&
|
{ (isOwnChat(group.userId)) &&
|
||||||
<div className="shrink-0 message-avatar">
|
<div className="shrink-0 message-avatar">
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export const NavigatorRoomSettingsModTabView: FC<NavigatorRoomSettingsTabViewPro
|
|||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
<Flex key={ index } shrink alignItems="center" gap={ 1 } overflow="hidden">
|
<Flex key={ index } shrink alignItems="center" gap={ 1 } overflow="hidden">
|
||||||
<UserProfileIconView userName={ user.userId } />
|
<UserProfileIconView userId={ user.userId } />
|
||||||
<Text pointer grow onClick={ event => setSelectedUserId(user.userId) }> { user.userName }</Text>
|
<Text pointer grow onClick={ event => setSelectedUserId(user.userId) }> { user.userName }</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ export const WiredExtraVariableEchoView: FC<{}> = () =>
|
|||||||
if(fallbackEntry) return [ fallbackEntry, ...variableEntries ];
|
if(fallbackEntry) return [ fallbackEntry, ...variableEntries ];
|
||||||
if(!fallbackSourceName) return variableEntries;
|
if(!fallbackSourceName) return variableEntries;
|
||||||
|
|
||||||
return [ {
|
const namedFallback: IWiredVariablePickerEntry = {
|
||||||
id: sourceVariableToken,
|
id: sourceVariableToken,
|
||||||
token: sourceVariableToken,
|
token: sourceVariableToken,
|
||||||
label: fallbackSourceName,
|
label: fallbackSourceName,
|
||||||
@@ -139,7 +139,9 @@ export const WiredExtraVariableEchoView: FC<{}> = () =>
|
|||||||
hasValue: true,
|
hasValue: true,
|
||||||
kind: 'custom',
|
kind: 'custom',
|
||||||
target: sourceTargetType
|
target: sourceTargetType
|
||||||
}, ...variableEntries ];
|
};
|
||||||
|
|
||||||
|
return [ namedFallback, ...variableEntries ];
|
||||||
}, [ fallbackSourceName, sourceTargetType, sourceVariableToken, variableEntries ]);
|
}, [ fallbackSourceName, sourceTargetType, sourceVariableToken, variableEntries ]);
|
||||||
|
|
||||||
const selectedEntry = useMemo(() => flattenWiredVariablePickerEntries(resolvedVariableEntries).find(entry => (entry.token === sourceVariableToken)) ?? null, [ resolvedVariableEntries, sourceVariableToken ]);
|
const selectedEntry = useMemo(() => flattenWiredVariablePickerEntries(resolvedVariableEntries).find(entry => (entry.token === sourceVariableToken)) ?? null, [ resolvedVariableEntries, sourceVariableToken ]);
|
||||||
|
|||||||
Reference in New Issue
Block a user