Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class RustPageAccessLevelRepositoryImpl implements PageAccessLevelRepository {
final result = await ViewBackendService.getView(pageId);
return result.fold(
(view) {
Log.info('get view success: ${view.id}');
Log.debug('get view(${view.id}) success');
return FlowyResult.success(view);
},
(error) {
Expand All @@ -33,7 +33,7 @@ class RustPageAccessLevelRepositoryImpl implements PageAccessLevelRepository {
final result = await ViewBackendService.lockView(pageId);
return result.fold(
(_) {
Log.info('lock view success: $pageId');
Log.debug('lock view($pageId) success');
return FlowyResult.success(null);
},
(error) {
Expand All @@ -48,7 +48,7 @@ class RustPageAccessLevelRepositoryImpl implements PageAccessLevelRepository {
final result = await ViewBackendService.unlockView(pageId);
return result.fold(
(_) {
Log.info('unlock view success: $pageId');
Log.debug('unlock view($pageId) success');
return FlowyResult.success(null);
},
(error) {
Expand All @@ -67,6 +67,7 @@ class RustPageAccessLevelRepositoryImpl implements PageAccessLevelRepository {
(s) => s,
(_) => null,
);

if (user == null) {
return FlowyResult.failure(
FlowyError(
Expand Down Expand Up @@ -100,7 +101,7 @@ class RustPageAccessLevelRepositoryImpl implements PageAccessLevelRepository {
)
?.accessLevel
.shareAccessLevel ??
ShareAccessLevel.readAndWrite;
ShareAccessLevel.readOnly;

Log.debug('current user access level: $accessLevel, in page: $pageId');

Expand All @@ -112,7 +113,7 @@ class RustPageAccessLevelRepositoryImpl implements PageAccessLevelRepository {
);

// return the read and write access level if the user is not found
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Update or remove outdated inline comment

The inline comment is now inaccurate; please update it to match the current return value or remove it.

return FlowyResult.success(ShareAccessLevel.readAndWrite);
return FlowyResult.success(ShareAccessLevel.readOnly);
},
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class PageAccessLevelState {
isLocked: false,
lockCounter: 0,
sectionType: SharedSectionType.public,
accessLevel: ShareAccessLevel
.readAndWrite, // replace it with readOnly if we support offline.
accessLevel: ShareAccessLevel.readOnly,
);

const PageAccessLevelState({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:appflowy/features/shared_section/data/repositories/local_shared_pages_repository_impl.dart';
import 'package:appflowy/features/shared_section/data/repositories/rust_shared_pages_repository_impl.dart';
import 'package:appflowy/features/shared_section/logic/shared_section_bloc.dart';
import 'package:appflowy/features/shared_section/presentation/widgets/refresh_button.dart';
import 'package:appflowy/features/shared_section/presentation/widgets/shared_page_list.dart';
Expand Down Expand Up @@ -30,8 +30,7 @@ class SharedSection extends StatelessWidget {

@override
Widget build(BuildContext context) {
// final repository = RustSharePagesRepositoryImpl();
final repository = LocalSharedPagesRepositoryImpl();
final repository = RustSharePagesRepositoryImpl();

return BlocProvider(
create: (_) => SharedSectionBloc(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:appflowy/features/share_tab/data/repositories/local_share_with_user_repository_impl.dart';
import 'package:appflowy/features/share_tab/data/repositories/rust_share_with_user_repository_impl.dart';
import 'package:appflowy/features/share_tab/logic/share_tab_bloc.dart';
import 'package:appflowy/features/workspace/logic/workspace_bloc.dart';
import 'package:appflowy/generated/locale_keys.g.dart';
Expand Down Expand Up @@ -44,8 +44,8 @@ class ShareButton extends StatelessWidget {
),
BlocProvider(
create: (context) => ShareTabBloc(
// repository: RustShareWithUserRepositoryImpl(),
repository: LocalShareWithUserRepositoryImpl(),
repository: RustShareWithUserRepositoryImpl(),
// repository: LocalShareWithUserRepositoryImpl(),
pageId: view.id,
workspaceId: workspaceId,
)..add(ShareTabEvent.initialize()),
Expand Down
Loading