mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 05:25:53 +08:00
refactor: workspace header (#1880)
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { PermissionType } from '@affine/workspace/affine/api';
|
||||
import { WorkspaceFlavour } from '@affine/workspace/type';
|
||||
|
||||
import type { AffineOfficialWorkspace } from '../../shared';
|
||||
|
||||
export function useIsWorkspaceOwner(workspace: AffineOfficialWorkspace) {
|
||||
if (workspace.flavour === 'local') return true;
|
||||
if (workspace.flavour === WorkspaceFlavour.LOCAL) return true;
|
||||
if (workspace.flavour === WorkspaceFlavour.PUBLIC) return false;
|
||||
return workspace.permission === PermissionType.Owner;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@ export function findSuitablePageId(
|
||||
null
|
||||
);
|
||||
}
|
||||
case WorkspaceFlavour.PUBLIC: {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user