mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-17 15:53:05 -05:00
tidy(ui): remove unused stuff
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
import { skipToken } from '@reduxjs/toolkit/query';
|
||||
import { useGetModelConfigQuery } from 'services/api/endpoints/models';
|
||||
import type { AnyModelConfig } from 'services/api/types';
|
||||
|
||||
export const useGetModelConfigWithTypeGuard = <T extends AnyModelConfig>(
|
||||
key: string | typeof skipToken,
|
||||
typeGuard: (config: AnyModelConfig) => config is T
|
||||
) => {
|
||||
const result = useGetModelConfigQuery(key ?? skipToken, {
|
||||
selectFromResult: (result) => {
|
||||
const modelConfig = result.currentData;
|
||||
return {
|
||||
...result,
|
||||
modelConfig: modelConfig && typeGuard(modelConfig) ? modelConfig : undefined,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return result;
|
||||
};
|
||||
Reference in New Issue
Block a user