fix: orgname not be shown in playground

This commit is contained in:
jialin
2026-05-29 13:35:22 +08:00
committed by jialin
parent faf0d4d605
commit 34098e8950
5 changed files with 29 additions and 5 deletions
+15
View File
@@ -110,3 +110,18 @@ const lookupOrgNamespace = (id: number | null): string | null => {
}
return null;
};
export const getAllOrganizations = (): Array<{ id: number; name?: string }> => {
const allOrganizations = localStorage.getItem('allOrganizations');
if (!allOrganizations) return [];
try {
const list = JSON.parse(allOrganizations) as Array<{
id: number;
name?: string;
}>;
if (!Array.isArray(list)) return [];
return list;
} catch {
return [];
}
};