Skip to content

Commit

Permalink
fix(client-electron): prevent flicker in json viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
marcincichocki committed Oct 11, 2022
1 parent 6e5c55b commit f26af63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/electron/renderer/pages/CalibrateFragment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TestThresholdData,
UpdateSettingsAction,
} from '@/electron/common';
import { useEffect, useState } from 'react';
import { useEffect, useLayoutEffect, useState } from 'react';
import { useOutletContext, useParams } from 'react-router-dom';
import styled from 'styled-components';
import { dispatchAsyncRequest, fromCamelCase } from '../common';
Expand Down Expand Up @@ -178,7 +178,7 @@ export const CalibrateFragment = () => {
? hexCodeValidator
: undefined;

useEffect(() => {
useLayoutEffect(() => {
setTestResult(result);
setTestThreshold(result.threshold ?? 0);
}, [fragmentId]);
Expand Down

0 comments on commit f26af63

Please sign in to comment.