Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mickr777 committed Oct 4, 2024
1 parent 651cc3a commit 6ea3e92
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Divider, Grid } from '@invoke-ai/ui-library';
import { createSelector } from '@reduxjs/toolkit';
import { useAppSelector } from 'app/store/storeHooks';
import { CanvasHUDItemBbox } from 'features/controlLayers/components/HUD/CanvasHUDItemBbox';
import { CanvasHUDItemScaledBbox } from 'features/controlLayers/components/HUD/CanvasHUDItemScaledBbox';
import { CanvasHUDItemStats } from 'features/controlLayers/components/HUD/CanvasHUDItemStats';
import { selectCanvasSettingsSlice } from 'features/controlLayers/store/canvasSettingsSlice';
import { memo } from 'react';

import { Divider, Grid } from '@invoke-ai/ui-library';
import { createSelector } from '@reduxjs/toolkit';

const selectCanvasSettings = createSelector(selectCanvasSettingsSlice, (canvasSettings) => ({
showSystemStats: canvasSettings.showSystemStats,
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export const CanvasHUDItemStats = memo(() => {
pollingInterval: 1000,
});

if (!systemStats) return null;
if (!systemStats) {
return null;
}

return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { FormControl, FormLabel, Switch } from '@invoke-ai/ui-library';
import { createSelector } from '@reduxjs/toolkit';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import {
selectCanvasSettingsSlice,
settingsShowHUDToggled,
settingsShowSystemStatsToggled,
} from 'features/controlLayers/store/canvasSettingsSlice';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';

import { FormControl, FormLabel, Switch } from '@invoke-ai/ui-library';
import { createSelector } from '@reduxjs/toolkit';

const selectShowHUD = createSelector(selectCanvasSettingsSlice, (canvasSettings) => canvasSettings.showHUD);
const selectShowSystemStats = createSelector(
selectCanvasSettingsSlice,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { PayloadAction, Selector } from '@reduxjs/toolkit';
import { createSelector, createSlice } from '@reduxjs/toolkit';
import type { PersistConfig, RootState } from 'app/store/store';
import { newCanvasSessionRequested, newGallerySessionRequested } from 'features/controlLayers/store/actions';
import type { RgbaColor } from 'features/controlLayers/store/types';

import { createSelector, createSlice } from '@reduxjs/toolkit';
import type { PayloadAction, Selector } from '@reduxjs/toolkit';

type CanvasSettingsState = {
/**
* Whether to show HUD (Heads-Up Display) on the canvas.
Expand Down Expand Up @@ -240,4 +239,3 @@ export const selectIsolatedTransformingPreview = createCanvasSettingsSelector(
(settings) => settings.isolatedTransformingPreview
);
export const selectPressureSensitivity = createCanvasSettingsSelector((settings) => settings.pressureSensitivity);
export const selectShowSystemStats = createCanvasSettingsSelector((settings) => settings.showSystemStats);

0 comments on commit 6ea3e92

Please sign in to comment.