Skip to content

Commit

Permalink
chore: fallback to documentbloc
Browse files Browse the repository at this point in the history
  • Loading branch information
richardshiue committed Feb 5, 2025
1 parent 6ce163f commit 93c9644
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:ui';

import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/document/application/document_bloc.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/block_menu/block_menu_button.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/copy_and_paste/clipboard_service.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/image/common.dart';
Expand Down Expand Up @@ -145,7 +146,8 @@ class _ImageMenuState extends State<ImageMenu> {
showDialog(
context: context,
builder: (_) => InteractiveImageViewer(
userProfile: context.read<UserWorkspaceBloc>().userProfile,
userProfile: context.read<UserWorkspaceBloc?>()?.userProfile ??
context.read<DocumentBloc>().state.userProfilePB,
imageProvider: AFBlockImageProvider(
images: [
ImageBlockData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class _ImageBrowserLayoutState extends State<ImageBrowserLayout> {
@override
void initState() {
super.initState();
_userProfile = context.read<UserWorkspaceBloc?>()?.userProfile;
_userProfile = context.read<UserWorkspaceBloc?>()?.userProfile ??
context.read<DocumentBloc>().state.userProfilePB;
}

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class _ResizableImageState extends State<ResizableImage> {

imageWidth = widget.width;

_userProfilePB = context.read<UserWorkspaceBloc?>()?.userProfile;
_userProfilePB = context.read<UserWorkspaceBloc?>()?.userProfile ??
context.read<DocumentBloc>().state.userProfilePB;
}

@override
Expand Down

0 comments on commit 93c9644

Please sign in to comment.