[regression]: space app editor helpers (#6646)

* fix: editor helpers

* fix: animation ref type

* fix: animation ref type
This commit is contained in:
Aaryan Khandelwal 2025-02-19 17:28:55 +05:30 committed by GitHub
parent 6303847026
commit 0c35e196be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -12,7 +12,7 @@ export const ImageUploadStatus: React.FC<Props> = (props) => {
// Displayed status that will animate smoothly
const [displayStatus, setDisplayStatus] = useState(0);
// Animation frame ID for cleanup
const animationFrameRef = useRef(null);
const animationFrameRef = useRef<number | null>(null);
// subscribe to image upload status
const uploadStatus: number | undefined = useEditorState({
editor,
@ -41,7 +41,7 @@ export const ImageUploadStatus: React.FC<Props> = (props) => {
};
animationFrameRef.current = requestAnimationFrame((time) => animation(time));
};
animateToValue(displayStatus, uploadStatus, performance.now());
animateToValue(displayStatus, uploadStatus == undefined ? 100 : uploadStatus, performance.now());
return () => {
if (animationFrameRef.current) {

View file

@ -59,7 +59,7 @@ export const getEditorFileHandlers = (args: TArgs): TFileHandler => {
anchor,
workspaceId,
}),
getAssetUploadStatus: () => 0,
assetsUploadStatus: {},
upload: uploadFile,
delete: async (src: string) => {
if (src?.startsWith("http")) {