mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-17 04:51:32 -05:00
Download events and invocation status events (including progress images) are very frequent. There's no real need for these to pass through redux. Handling them outside redux is a significant performance win - far fewer store subscription calls, far fewer trips through middleware. All event handling is moved outside middleware. Cleanup of unused actions and listeners to follow.
24 lines
672 B
TypeScript
24 lines
672 B
TypeScript
import { Icon, Tooltip } from '@invoke-ai/ui-library';
|
|
import { useStore } from '@nanostores/react';
|
|
import { $isConnected } from 'app/hooks/useSocketIO';
|
|
import { memo } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { PiWarningBold } from 'react-icons/pi';
|
|
|
|
const StatusIndicator = () => {
|
|
const isConnected = useStore($isConnected);
|
|
const { t } = useTranslation();
|
|
|
|
if (!isConnected) {
|
|
return (
|
|
<Tooltip label={t('common.statusDisconnected')} placement="end" shouldWrapChildren gutter={10}>
|
|
<Icon as={PiWarningBold} color="error.300" />
|
|
</Tooltip>
|
|
);
|
|
}
|
|
|
|
return null;
|
|
};
|
|
|
|
export default memo(StatusIndicator);
|