mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
fix: disable adding same embedded url in onAddBox
This commit is contained in:
@@ -162,6 +162,7 @@ const LinkPreview: React.FC<LinkPreviewProps> = ({
|
||||
backgroundImage: `url(${image})`,
|
||||
height: 'auto',
|
||||
flex: 1,
|
||||
minH: '12rem',
|
||||
width: '100%',
|
||||
backgroundSize: 'cover',
|
||||
backgroundRepeat: 'no-repeat',
|
||||
|
||||
@@ -313,6 +313,10 @@ export const Grid: React.FC<Props> = ({ player }): ReactElement => {
|
||||
|
||||
const onAddBox = useCallback(
|
||||
(boxType: BoxType, boxMetadata: BoxMetadata): void => {
|
||||
const boxKey = getBoxKey(boxType, boxMetadata);
|
||||
if (currentLayoutItems.find((item) => item.boxKey === boxKey)) {
|
||||
return;
|
||||
}
|
||||
const layoutData = {
|
||||
layouts: addBoxToLayouts(boxType, boxMetadata, currentLayouts),
|
||||
layoutItems: [
|
||||
|
||||
Reference in New Issue
Block a user