mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-25 20:01:03 +00:00
feat: remove nullables
This commit is contained in:
2
src/renderer/src/declaration.d.ts
vendored
2
src/renderer/src/declaration.d.ts
vendored
@@ -134,7 +134,7 @@ declare global {
|
||||
displayName: string,
|
||||
newProfileImagePath: string | null
|
||||
) => Promise<UserProfile>;
|
||||
getFriendRequests: () => Promise<FriendRequest[] | null>;
|
||||
getFriendRequests: () => Promise<FriendRequest[]>;
|
||||
updateFriendRequest: (
|
||||
userId: string,
|
||||
action: FriendRequestAction
|
||||
|
||||
@@ -91,7 +91,7 @@ export function useUserDetails() {
|
||||
|
||||
const updateFriendRequests = useCallback(async () => {
|
||||
const friendRequests = await window.electron.getFriendRequests();
|
||||
dispatch(setFriendRequests(friendRequests || []));
|
||||
dispatch(setFriendRequests(friendRequests));
|
||||
}, [dispatch]);
|
||||
|
||||
const showFriendsModal = useCallback(
|
||||
|
||||
@@ -119,7 +119,7 @@ export const UserFriendModalAddFriend = ({
|
||||
}}
|
||||
>
|
||||
<h3>Pendentes</h3>
|
||||
{friendRequests?.map((request) => {
|
||||
{friendRequests.map((request) => {
|
||||
return (
|
||||
<UserFriendRequest
|
||||
key={request.id}
|
||||
|
||||
@@ -224,7 +224,7 @@ export function UserContent({
|
||||
<div className={styles.profileGameSection}>
|
||||
<h2>{t("activity")}</h2>
|
||||
|
||||
{!userProfile.recentGames?.length ? (
|
||||
{!userProfile.recentGames.length ? (
|
||||
<div className={styles.noDownloads}>
|
||||
<div className={styles.telescopeIcon}>
|
||||
<TelescopeIcon size={24} />
|
||||
@@ -295,7 +295,7 @@ export function UserContent({
|
||||
}}
|
||||
/>
|
||||
<h3 style={{ fontWeight: "400" }}>
|
||||
{userProfile.libraryGames?.length}
|
||||
{userProfile.libraryGames.length}
|
||||
</h3>
|
||||
</div>
|
||||
<small>{t("total_play_time", { amount: formatPlayTime() })}</small>
|
||||
@@ -306,7 +306,7 @@ export function UserContent({
|
||||
gap: `${SPACING_UNIT}px`,
|
||||
}}
|
||||
>
|
||||
{userProfile.libraryGames?.map((game) => (
|
||||
{userProfile.libraryGames.map((game) => (
|
||||
<button
|
||||
key={game.objectID}
|
||||
className={cn(styles.gameListItem, styles.profileContentBox)}
|
||||
@@ -344,7 +344,7 @@ export function UserContent({
|
||||
}}
|
||||
/>
|
||||
<h3 style={{ fontWeight: "400" }}>
|
||||
{userProfile.friends?.length || 0}
|
||||
{userProfile.friends.length}
|
||||
</h3>
|
||||
</button>
|
||||
|
||||
@@ -355,7 +355,7 @@ export function UserContent({
|
||||
gap: `${SPACING_UNIT}px`,
|
||||
}}
|
||||
>
|
||||
{userProfile.friends?.map((friend) => {
|
||||
{userProfile.friends.map((friend) => {
|
||||
return (
|
||||
<button
|
||||
key={friend.id}
|
||||
|
||||
Reference in New Issue
Block a user