Skip to content

Commit

Permalink
fix: open the first page instead of opening last opened page
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Jul 5, 2024
1 parent 7706d7a commit e9d3c84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:appflowy_backend/protobuf/flowy-folder/workspace.pb.dart'
show WorkspaceSettingPB;
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';

part 'home_bloc.freezed.dart';

class HomeBloc extends Bloc<HomeEvent, HomeState> {
Expand Down Expand Up @@ -47,14 +48,9 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> {
emit(state.copyWith(isLoading: e.isLoading));
},
didReceiveWorkspaceSetting: (_DidReceiveWorkspaceSetting value) {
final latestView = value.setting.hasLatestView()
? value.setting.latestView
: state.latestView;

emit(
state.copyWith(
workspaceSetting: value.setting,
latestView: latestView,
),
);
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'dart:async';

import 'package:flutter/material.dart';

import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:appflowy/plugins/blank/blank.dart';
Expand Down Expand Up @@ -37,6 +35,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

Loading? _duplicateSpaceLoading;
Expand Down Expand Up @@ -121,7 +120,7 @@ class HomeSideBar extends StatelessWidget {
userProfile,
state.currentWorkspace?.workspaceId ??
workspaceSetting.workspaceId,
openFirstPage: false,
openFirstPage: true,
),
),
),
Expand Down

0 comments on commit e9d3c84

Please sign in to comment.