Shared debug

This commit is contained in:
mr 2024-11-19 15:33:55 +01:00
parent 6be0fbac7d
commit 06b13853db

View File

@ -349,7 +349,7 @@ class WorkspaceSharedPageWidgetState extends State<WorkspaceSharedPageWidget> {
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<WorkspaceSharedPageWidget> {
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<WorkspaceSharedPageWidget> {
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<WorkspaceSharedPageWidget> {
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);