Update to JS coding standard v2.5.0

This commit is contained in:
Alejandro Celaya
2024-06-06 17:49:12 +02:00
parent fa39302474
commit b2908d2b1f
8 changed files with 1769 additions and 966 deletions

View File

@@ -44,4 +44,4 @@ export const isNotFoundServer = (server: SelectedServer): server is NotFoundServ
export const getServerId = (server: SelectedServer) => (isServerWithId(server) ? server.id : '');
export const serverWithIdToServerData = ({ id, autoConnect, ...server }: ServerWithId): ServerData => server;
export const serverWithIdToServerData = ({ name, url, apiKey }: ServerWithId): ServerData => ({ name, url, apiKey });

View File

@@ -44,8 +44,8 @@ export const { actions, reducer } = createSlice({
},
},
deleteServer: (state, { payload }) => {
const { [payload.id]: deletedServer, ...rest } = state;
return rest;
delete state[payload.id];
return state;
},
setAutoConnect: {
prepare: ({ id: serverId }: ServerWithId, autoConnect: boolean) => ({