[regression]: space app editor helpers (#6646)
* fix: editor helpers * fix: animation ref type * fix: animation ref type
This commit is contained in:
parent
6303847026
commit
0c35e196be
2 changed files with 3 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue