mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-18 01:11:20 -05:00
feat(ui): rerender mitigation sweep
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Flex, Image, Spinner } from '@chakra-ui/react';
|
||||
import InvokeAILogoImage from 'assets/images/logo.png';
|
||||
import { memo } from 'react';
|
||||
|
||||
// This component loads before the theme so we cannot use theme tokens here
|
||||
|
||||
@@ -29,4 +30,4 @@ const Loading = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Loading;
|
||||
export default memo(Loading);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { RootState } from 'app/store/store';
|
||||
import { useAppSelector } from 'app/store/storeHooks';
|
||||
import { useCallback } from 'react';
|
||||
import { OpenAPI } from 'services/api';
|
||||
|
||||
export const getUrlAlt = (url: string, shouldTransformUrls: boolean) => {
|
||||
@@ -15,14 +16,19 @@ export const useGetUrl = () => {
|
||||
(state: RootState) => state.config.shouldTransformUrls
|
||||
);
|
||||
|
||||
return {
|
||||
shouldTransformUrls,
|
||||
getUrl: (url?: string) => {
|
||||
const getUrl = useCallback(
|
||||
(url?: string) => {
|
||||
if (OpenAPI.BASE && shouldTransformUrls) {
|
||||
return [OpenAPI.BASE, url].join('/');
|
||||
}
|
||||
|
||||
return url;
|
||||
},
|
||||
[shouldTransformUrls]
|
||||
);
|
||||
|
||||
return {
|
||||
shouldTransformUrls,
|
||||
getUrl,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user