|
@@ -196,12 +196,12 @@ export default function ProjectDetailPage() {
|
|
|
const isOwner = project?.ownerId === user?.id;
|
|
const isOwner = project?.ownerId === user?.id;
|
|
|
const isAdmin = user?.globalRole === 'ADMIN';
|
|
const isAdmin = user?.globalRole === 'ADMIN';
|
|
|
|
|
|
|
|
- // Poll workspace-wide stuck job count every 30s (only for admins)
|
|
|
|
|
|
|
+ // Poll workspace-wide stuck job count every 30s (admins can use it; badge shows for canManage)
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
if (!isAdmin || !token) return;
|
|
if (!isAdmin || !token) return;
|
|
|
let cancelled = false;
|
|
let cancelled = false;
|
|
|
async function fetchStuckCount() {
|
|
async function fetchStuckCount() {
|
|
|
- const t = token as string; // guarded above
|
|
|
|
|
|
|
+ const t = token as string;
|
|
|
try {
|
|
try {
|
|
|
const data = await assetsApi.getStuckCount(t);
|
|
const data = await assetsApi.getStuckCount(t);
|
|
|
if (!cancelled) setGlobalStuckCount(data.count ?? 0);
|
|
if (!cancelled) setGlobalStuckCount(data.count ?? 0);
|