Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: image upload loading (#6351)

Mathias Mogensen6ddbb418eb38
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/image/image_placeholder.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/image/image_placeholder.dart
index b4da27f678..739f5084b7 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/image/image_placeholder.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/image/image_placeholder.dart
@@ -255,6 +255,10 @@ class ImagePlaceholderState extends State<ImagePlaceholder> {
Future<void> insertMultipleLocalImages(List<String> urls) async {
controller.close();
+ if (urls.isEmpty) {
+ return;
+ }
+
setState(() {
showLoading = true;
errorMessage = null;
@@ -263,10 +267,6 @@ class ImagePlaceholderState extends State<ImagePlaceholder> {
bool hasError = false;
if (_isLocalMode()) {
- if (urls.isEmpty) {
- return;
- }
-
final first = urls.removeAt(0);
final firstPath = await saveImageToLocalStorage(first);
final transaction = editorState.transaction;