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