mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: favorite section doesn't update after switching workspace (#5025)
This commit is contained in:
parent
723423d423
commit
75e51fdeea
@ -1,5 +1,3 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
|
||||||
|
|
||||||
import 'package:appflowy/plugins/util.dart';
|
import 'package:appflowy/plugins/util.dart';
|
||||||
import 'package:appflowy/startup/plugin/plugin.dart';
|
import 'package:appflowy/startup/plugin/plugin.dart';
|
||||||
import 'package:appflowy/startup/startup.dart';
|
import 'package:appflowy/startup/startup.dart';
|
||||||
@ -8,11 +6,12 @@ import 'package:appflowy/workspace/presentation/home/home_stack.dart';
|
|||||||
import 'package:appflowy/workspace/presentation/home/menu/menu_shared_state.dart';
|
import 'package:appflowy/workspace/presentation/home/menu/menu_shared_state.dart';
|
||||||
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
|
||||||
import 'package:bloc/bloc.dart';
|
import 'package:bloc/bloc.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
|
|
||||||
|
part 'tabs_bloc.freezed.dart';
|
||||||
part 'tabs_event.dart';
|
part 'tabs_event.dart';
|
||||||
part 'tabs_state.dart';
|
part 'tabs_state.dart';
|
||||||
part 'tabs_bloc.freezed.dart';
|
|
||||||
|
|
||||||
class TabsBloc extends Bloc<TabsEvent, TabsState> {
|
class TabsBloc extends Bloc<TabsEvent, TabsState> {
|
||||||
TabsBloc() : super(TabsState()) {
|
TabsBloc() : super(TabsState()) {
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:appflowy/startup/plugin/plugin.dart';
|
||||||
import 'package:appflowy/startup/startup.dart';
|
import 'package:appflowy/startup/startup.dart';
|
||||||
|
import 'package:appflowy/workspace/application/favorite/favorite_bloc.dart';
|
||||||
|
import 'package:appflowy/workspace/application/favorite/prelude.dart';
|
||||||
import 'package:appflowy/workspace/application/menu/sidebar_sections_bloc.dart';
|
import 'package:appflowy/workspace/application/menu/sidebar_sections_bloc.dart';
|
||||||
import 'package:appflowy/workspace/application/notifications/notification_action.dart';
|
import 'package:appflowy/workspace/application/notifications/notification_action.dart';
|
||||||
import 'package:appflowy/workspace/application/notifications/notification_action_bloc.dart';
|
import 'package:appflowy/workspace/application/notifications/notification_action_bloc.dart';
|
||||||
@ -103,6 +106,11 @@ class HomeSideBar extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
BlocListener<UserWorkspaceBloc, UserWorkspaceState>(
|
BlocListener<UserWorkspaceBloc, UserWorkspaceState>(
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
|
context.read<TabsBloc>().add(
|
||||||
|
TabsEvent.openPlugin(
|
||||||
|
plugin: makePlugin(pluginType: PluginType.blank),
|
||||||
|
),
|
||||||
|
);
|
||||||
context.read<SidebarSectionsBloc>().add(
|
context.read<SidebarSectionsBloc>().add(
|
||||||
SidebarSectionsEvent.initial(
|
SidebarSectionsEvent.initial(
|
||||||
userProfile,
|
userProfile,
|
||||||
@ -110,6 +118,9 @@ class HomeSideBar extends StatelessWidget {
|
|||||||
workspaceSetting.workspaceId,
|
workspaceSetting.workspaceId,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
context.read<FavoriteBloc>().add(
|
||||||
|
const FavoriteEvent.fetchFavorites(),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user