Skip to content

Commit 3e908f0

Browse files
committed
chore: swap lambda and use the util class
1 parent 2a8fc9f commit 3e908f0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

api/src/unraid-api/graph/resolvers/array/array.service.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ import {
1313
ArrayStateInputState,
1414
} from '@app/graphql/generated/api/types.js';
1515
import { getters } from '@app/store/index.js';
16+
import { arrayIsRunning as arrayIsRunningUtil } from '@app/core/utils/index.js';
1617

1718
@Injectable()
1819
export class ArrayService {
1920
private pendingState: ArrayPendingState | null = null;
2021

2122
/**
2223
* Is the array running?
24+
* @todo Refactor this to include this util in the service directly
2325
*/
24-
arrayIsRunning = () => {
25-
const emhttp = getters.emhttp();
26-
return emhttp.var.mdState === ArrayState.STARTED;
27-
};
26+
private arrayIsRunning() {
27+
return arrayIsRunningUtil();
28+
}
2829

2930
async updateArrayState({ desiredState }: ArrayStateInput): Promise<ArrayType> {
3031
const startState = this.arrayIsRunning() ? ArrayState.STARTED : ArrayState.STOPPED;

0 commit comments

Comments
 (0)