From 06b13853db95563b50f4f3aadb6ed1a2bc735be3 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 19 Nov 2024 15:33:55 +0100 Subject: [PATCH] Shared debug --- lib/pages/shared.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pages/shared.dart b/lib/pages/shared.dart index 5b63c01..8a4d3a9 100644 --- a/lib/pages/shared.dart +++ b/lib/pages/shared.dart @@ -349,7 +349,7 @@ class WorkspaceSharedPageWidgetState extends State { items.add(ShallowItemRowWidget( color: Colors.grey.shade200, item: w, badges: badges, - delete: w is Peer && PermsService.getPerm(Perms.PEER_UNSHARE) ? (String? change) async { + delete: w is Peer && PermsService.getPerm(Perms.PEER_UNSHARE) && w.getID() != CollaborativeAreaLocal.workspaces[CollaborativeAreaLocal.current ?? ""]?.rule?.creator ? (String? change) async { await SharedService().removePeer(context, CollaborativeAreaLocal.current ?? "", change ?? ""); await CollaborativeAreaLocal.init(context, false); setState(() {}); @@ -452,7 +452,7 @@ class WorkspaceSharedPageWidgetState extends State { return shals; }, width: getMainWidth(context) / 3, - canLoad: (String? change) => !space.peers.map( (e) => e.id ).contains(change), + canLoad: (String? change) => true, load: (String val) async { await service.addPeer(context, CollaborativeAreaLocal.current ?? "", val); await CollaborativeAreaLocal.init(context, false); @@ -484,7 +484,7 @@ class WorkspaceSharedPageWidgetState extends State { prefixIcon: Icon(Icons.shopping_cart, color: Colors.grey), all: () async => WorkspaceLocal.getWorkspacesShallow().where( (e) => !space.workspaces.map( (e) => e.id ).contains(e.id)).toList(), width: getMainWidth(context) / 3, - canLoad: (String? change) => !space.workspaces.map( (e) => e.id ).contains(change), + canLoad: (String? change) => true, load: (String val) async { await service.addWorkspace(context, CollaborativeAreaLocal.current ?? "", val); await CollaborativeAreaLocal.init(context, false); @@ -524,7 +524,7 @@ class WorkspaceSharedPageWidgetState extends State { return shals; }, width: getMainWidth(context) / 3, - canLoad: (String? change) => !space.workflows.map( (e) => e.id ).contains(change), + canLoad: (String? change) => true, load: (String val) async { await service.addWorkflow(context, CollaborativeAreaLocal.current ?? "", val); await CollaborativeAreaLocal.init(context, false);