chore: clean up

This commit is contained in:
Louis 2025-06-30 15:19:27 +07:00
parent 9b730058b4
commit 66bae2adb8
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2
2 changed files with 4 additions and 5 deletions

View File

@ -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 {

View File

@ -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) => (