Skip to content

Commit 0a89a98

Browse files
committed
can be projects too
1 parent 0163986 commit 0a89a98

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/lib/helpers/project.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ export function getProjectEndpoint(): string {
4747

4848
export function isProjectBlocked(project: Models.Project | null | undefined): boolean {
4949
const hasGlobalProjectBlock = (project?.blocks ?? []).some((block) => {
50-
const type = block.resourceType?.trim();
50+
const type = block.resourceType?.trim().toLowerCase();
5151
const id = block.resourceId?.trim();
5252

53-
// Global project block: no specific resourceType or resourceId set
54-
return !type && !id;
53+
// Global project block:
54+
// - legacy: both type and id empty
55+
// - new: resourceType === 'projects' with no specific resourceId
56+
const isLegacyGlobal = !type && !id;
57+
const isProjectsGlobal = type === 'projects' && !id;
58+
59+
return isLegacyGlobal || isProjectsGlobal;
5560
});
5661

5762
return project?.status !== 'paused' && hasGlobalProjectBlock;

0 commit comments

Comments
 (0)