Skip to content

Commit

Permalink
fix read state
Browse files Browse the repository at this point in the history
  • Loading branch information
vraja-nayaka committed Jan 20, 2025
1 parent 0cc7368 commit ddff3cd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ export const CatIdentifier = () => {
<Card
title="Cat identifier"
description="Upload any image to see if the AI detects a cat. The model will analyze the picture and let you know if a cat is present—true for cats, false for no cats."
canvasSlot={
<div
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
height: "100%",
}}
>
Comming soon...
</div>
}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const DigitRecognizer = () => {
useReadRpcState();

const onSuccess = () =>
retryWhileDataChanged(() => {
retryWhileDataChanged().then(() => {
setIsSubmiting(false);
setIsSubmited(true);
});
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const useReadRpcState = () => {
enabled: !!mirrorId,
});

const retryWhileDataChanged = (onSuccess?: () => void) =>
const retryWhileDataChanged = () =>
new Promise<void>((resolve) => {
const prevData = JSON.stringify(data);

Expand All @@ -84,7 +84,6 @@ export const useReadRpcState = () => {
}, 1000);
} else {
resolve();
onSuccess?.();
}
};

Expand Down

0 comments on commit ddff3cd

Please sign in to comment.