chore: clean up
This commit is contained in:
parent
9b730058b4
commit
66bae2adb8
@ -1,7 +1,6 @@
|
|||||||
import { create } from 'zustand'
|
import { create } from 'zustand'
|
||||||
import { persist, createJSONStorage } from 'zustand/middleware'
|
import { persist, createJSONStorage } from 'zustand/middleware'
|
||||||
import { localStorageKey } from '@/constants/localStorage'
|
import { localStorageKey } from '@/constants/localStorage'
|
||||||
import { setActiveGpus } from '@/services/hardware'
|
|
||||||
|
|
||||||
// Hardware data types
|
// Hardware data types
|
||||||
export interface CPU {
|
export interface CPU {
|
||||||
@ -196,7 +195,7 @@ export const useHardware = create<HardwareStore>()(
|
|||||||
})),
|
})),
|
||||||
|
|
||||||
toggleGPUActivation: async (index) => {
|
toggleGPUActivation: async (index) => {
|
||||||
const { pausePolling, setGpuLoading, resumePolling } = get()
|
const { pausePolling, setGpuLoading } = get()
|
||||||
pausePolling()
|
pausePolling()
|
||||||
setGpuLoading(index, true)
|
setGpuLoading(index, true)
|
||||||
// try {
|
// try {
|
||||||
|
|||||||
@ -151,10 +151,10 @@ function Hardware() {
|
|||||||
if (over && active.id !== over.id) {
|
if (over && active.id !== over.id) {
|
||||||
// Find the indices of the dragged item and the drop target
|
// Find the indices of the dragged item and the drop target
|
||||||
const oldIndex = hardwareData.gpus.findIndex(
|
const oldIndex = hardwareData.gpus.findIndex(
|
||||||
(gpu, index) => index === active.id
|
(_, index) => index === active.id
|
||||||
)
|
)
|
||||||
const newIndex = hardwareData.gpus.findIndex(
|
const newIndex = hardwareData.gpus.findIndex(
|
||||||
(gpu, index) => index === over.id
|
(_, index) => index === over.id
|
||||||
)
|
)
|
||||||
|
|
||||||
if (oldIndex !== -1 && newIndex !== -1) {
|
if (oldIndex !== -1 && newIndex !== -1) {
|
||||||
@ -388,7 +388,7 @@ function Hardware() {
|
|||||||
onDragEnd={handleDragEnd}
|
onDragEnd={handleDragEnd}
|
||||||
>
|
>
|
||||||
<SortableContext
|
<SortableContext
|
||||||
items={hardwareData.gpus.map((gpu, index) => index)}
|
items={hardwareData.gpus.map((_, index) => index)}
|
||||||
strategy={verticalListSortingStrategy}
|
strategy={verticalListSortingStrategy}
|
||||||
>
|
>
|
||||||
{hardwareData.gpus.map((gpu, index) => (
|
{hardwareData.gpus.map((gpu, index) => (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user