Version Info and modal titles
This commit is contained in:
@@ -22,6 +22,7 @@ interface AppState {
|
||||
HTTP: Types.HTTPConnectionParameters;
|
||||
SERIAL: Types.SerialConnectionParameters;
|
||||
};
|
||||
updateAvaliable: boolean;
|
||||
}
|
||||
|
||||
const initialState: AppState = {
|
||||
@@ -41,6 +42,7 @@ const initialState: AppState = {
|
||||
},
|
||||
SERIAL: {},
|
||||
},
|
||||
updateAvaliable: false,
|
||||
};
|
||||
|
||||
export const appSlice = createSlice({
|
||||
@@ -77,6 +79,9 @@ export const appSlice = createSlice({
|
||||
state.connectionParams[connType[action.payload.type]] =
|
||||
action.payload.params;
|
||||
},
|
||||
setUpdateAvaliable(state, action: PayloadAction<boolean>) {
|
||||
state.updateAvaliable = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -88,6 +93,7 @@ export const {
|
||||
setCurrentPage,
|
||||
setConnType,
|
||||
setConnectionParams,
|
||||
setUpdateAvaliable,
|
||||
} = appSlice.actions;
|
||||
|
||||
export default appSlice.reducer;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export default async function fetcher<JSON>(
|
||||
export const fetcher = async <JSON>(
|
||||
input: RequestInfo,
|
||||
init?: RequestInit,
|
||||
): Promise<JSON> {
|
||||
): Promise<JSON> => {
|
||||
const res = await fetch(input, init);
|
||||
return res.json() as Promise<JSON>;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { request } from 'graphql-request';
|
||||
|
||||
export default async function gqlFetcher<JSON>(
|
||||
url: string,
|
||||
query?: string,
|
||||
): Promise<JSON> {
|
||||
// const res = await fetch(input, init);
|
||||
return await request<JSON>(url, query);
|
||||
}
|
||||
Reference in New Issue
Block a user