Skip to content

Commit

Permalink
fix: removed unneccecary code and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinrefvol committed Oct 15, 2024
1 parent 41e9e02 commit 4243029
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ export const ModelImageCanvas = ({
img.onload = () => {
// Scale image down based on the size of the parent
const container = canvas.parentElement;
const containerWidth = container!.clientWidth;
const containerHeight = container!.clientHeight;
if (container === null) return;
const containerWidth = container.clientWidth;
const containerHeight = container.clientHeight;
const scaleX = containerWidth / img.width;
const scaleY = containerHeight / img.height;
const scale = Math.min(scaleX, scaleY); // Use the smaller scale factor
Expand Down
11 changes: 2 additions & 9 deletions src/features/ModelView/ModelMetadataView/ModelMetadataView.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable max-lines */
/* eslint-disable max-lines-per-function */
import { Button, Dialog, Typography } from '@equinor/eds-core-react';
import { Button, Typography } from '@equinor/eds-core-react';
import { useMutation, useQuery } from '@tanstack/react-query';
import { useCallback, useEffect, useRef,useState } from 'react';
import { useCallback, useEffect, useRef, useState } from 'react';
import { useParams } from 'react-router-dom';
import {
AddAnalogueModelMetadataCommandForm,
Expand All @@ -26,7 +26,6 @@ import { EditNameDescription } from '../EditNameDescription/EditNameDescription'
import * as Styled from './ModelMetadataView.styled';
import { getAnalogueModelImage } from '../../../api/custom/getAnalogueModelImageById';


export const ModelMetadataView = ({
modelIdParent,
uploadingProgress,
Expand All @@ -41,14 +40,8 @@ export const ModelMetadataView = ({

const generateImageRequested = useRef(false);

const [stratColumnObject, setStratColumnObject] = useState<StratColumnType>(
defaultStratColumnData,
);
const [showStratColDialog, setShowStratColDialog] = useState<boolean>(false);

const { modelId } = useParams();


const defaultMetadata: AnalogueModelDetail = {
analogueModelId: data?.data.analogueModelId
? data?.data.analogueModelId
Expand Down

0 comments on commit 4243029

Please sign in to comment.