Changeset ad3c219


Ignore:
Timestamp:
03/01/26 19:48:21 (4 months ago)
Author:
Mihail <mihail2.naumov@…>
Branches:
main
Children:
4ceb725
Parents:
9d40151
Message:

Added check so that user cant rate his own builds

File:
1 edited

Legend:

Unmodified
Added
Removed
  • components/BuildDetailsDialog.tsx

    r9d40151 rad3c219  
    7777        }
    7878    }, [open, buildId]);
    79 
    8079
    8180    const handleFavorite = async () => {
     
    125124        }
    126125    };
     126
     127    const isCreator = currentUser && details && details.userId === currentUser;
    127128
    128129    if (!open) return null;
     
    305306                                        </Box>
    306307
    307                                         {currentUser && details.userId !== currentUser.id && (
     308                                        {currentUser && !isCreator && (
    308309                                            <Box sx={{mb: 4, p: 2, border: '1px solid #ddd', borderRadius: 2}}>
    309310                                                <Typography variant="subtitle2" gutterBottom>Your Review</Typography>
     
    327328                                        )}
    328329
    329                                         {currentUser && details.userId === currentUser.id && (
    330                                             <Alert severity="info" sx={{mb: 4}}>
     330                                        {currentUser && isCreator && (
     331                                            <Alert severity="error" sx={{mb: 4}}>
    331332                                                You cannot rate your own builds.
    332333                                            </Alert>
Note: See TracChangeset for help on using the changeset viewer.