mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
tidy(ui): remove extraneous fallback in QueueCountBadge
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import { Badge, Portal } from '@invoke-ai/ui-library';
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { selectActiveTab } from 'features/ui/store/uiSelectors';
|
||||
import { $isLeftPanelOpen, TABS_WITH_LEFT_PANEL } from 'features/ui/store/uiSlice';
|
||||
import { $isLeftPanelOpen } from 'features/ui/store/uiSlice';
|
||||
import type { RefObject } from 'react';
|
||||
import { memo, useEffect, useState } from 'react';
|
||||
import { useGetQueueStatusQuery } from 'services/api/endpoints/queue';
|
||||
@@ -12,13 +9,8 @@ type Props = {
|
||||
targetRef: RefObject<HTMLDivElement>;
|
||||
};
|
||||
|
||||
const selectActiveTabShouldShowBadge = createSelector(selectActiveTab, (activeTab) =>
|
||||
TABS_WITH_LEFT_PANEL.includes(activeTab)
|
||||
);
|
||||
|
||||
export const QueueCountBadge = memo(({ targetRef }: Props) => {
|
||||
const [badgePos, setBadgePos] = useState<{ x: string; y: string } | null>(null);
|
||||
const activeTabShouldShowBadge = useAppSelector(selectActiveTabShouldShowBadge);
|
||||
const isParametersPanelOpen = useStore($isLeftPanelOpen);
|
||||
const { queueSize } = useGetQueueStatusQuery(undefined, {
|
||||
selectFromResult: (res) => ({
|
||||
@@ -64,9 +56,6 @@ export const QueueCountBadge = memo(({ targetRef }: Props) => {
|
||||
if (!isParametersPanelOpen) {
|
||||
return null;
|
||||
}
|
||||
if (!activeTabShouldShowBadge) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Portal>
|
||||
|
||||
Reference in New Issue
Block a user