Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

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

Aaryan Khandelwal0c35e196bed5
diff --git a/packages/editor/src/core/extensions/custom-image/components/upload-status.tsx b/packages/editor/src/core/extensions/custom-image/components/upload-status.tsx
index 8492d51944..7b23713e9e 100644
--- a/packages/editor/src/core/extensions/custom-image/components/upload-status.tsx
+++ b/packages/editor/src/core/extensions/custom-image/components/upload-status.tsx
@@ -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) {
diff --git a/space/helpers/editor.helper.ts b/space/helpers/editor.helper.ts
index 0907b421e0..5126b99c7b 100644
--- a/space/helpers/editor.helper.ts
+++ b/space/helpers/editor.helper.ts
@@ -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")) {