message: Keep track of active pages in local state
diff: @@ -20,6 +20,8 @@ type ODFSystemDashboardPageProps = Omit<DashboardsPageProps, 'match'> & {
  match: Match<{ systemName: string }>;
  };
  +const blockPoolRef = referenceForModel(CephBlockPoolModel);
  +
  const ODFSystemDashboard: React.FC<ODFSystemDashboardPageProps> = ({
  kindsInFlight,
  k8sModels,
  @@ -31,23 +33,26 @@ const ODFSystemDashboard: React.FC<ODFSystemDashboardPageProps> = ({
  const { systemName } = rest.match.params;
  const dashboardTab = !isCephAvailable && isObjectServiceAvailable ? OBJECT : BLOCK_FILE;
  const defaultDashboard = React.useRef(dashboardTab);
  -
  - const pages: Page[] = [
  + const [pages, setPages] = React.useState<Page[]>([
  {
  path: 'overview/:dashboard',
  href: `overview/${defaultDashboard.current}`,
  name: t('ceph-storage-plugin~Overview'),
  component: OCSOverview,
  },
  - ];
  + ]);
  React.useEffect(() => {
  - if (isCephAvailable) {
  - pages.push({
  - href: referenceForModel(CephBlockPoolModel),
  + const isBlockPoolAdded = pages.find((page) => page.href === blockPoolRef);
  + if (isCephAvailable && !isBlockPoolAdded) {
  + setPages([
  + ...pages,
  + {
  + href: blockPoolRef,
  name: t('ceph-storage-plugin~BlockPools'),
  component: () => <BlockPoolListPage namespace={CEPH_STORAGE_NAMESPACE} />,
  - });
  + },
  + ]);
  }
  }, [isCephAvailable, pages, t]);
  