Browse Source

Add serverType to config store

master
jeffvli 3 years ago
committed by Jeff
parent
commit
662b508161
  1. 2
      src/__tests__/App.test.tsx
  2. 3
      src/redux/configSlice.ts

2
src/__tests__/App.test.tsx

@ -13,6 +13,7 @@ import { FolderSelection } from '../redux/folderSlice';
import { FavoritePage } from '../redux/favoriteSlice';
import App from '../App';
import { AlbumPage } from '../redux/albumSlice';
import { Server } from '../api/types';
const middlewares: Middleware<Record<string, unknown>, any, Dispatch<AnyAction>>[] | undefined = [];
const mockStore = configureMockStore(middlewares);
@ -115,6 +116,7 @@ const configState: ConfigPage = {
filters: [],
},
sort: {},
serverType: Server.Subsonic,
lookAndFeel: {
listView: {
music: {

3
src/redux/configSlice.ts

@ -3,6 +3,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import settings from 'electron-settings';
import { mockSettings } from '../shared/mockSettings';
import { moveSelectedToIndex } from '../shared/utils';
import { Server } from '../api/types';
const parsedSettings: any = process.env.NODE_ENV === 'test' ? mockSettings : settings.getSync();
@ -41,6 +42,7 @@ export interface ConfigPage {
alignment: string | 'flex-start' | 'center';
};
};
serverType: Server;
}
interface SortColumn {
@ -126,6 +128,7 @@ const initialState: ConfigPage = {
alignment: String(parsedSettings.gridAlignment),
},
},
serverType: parsedSettings.serverType,
};
const configSlice = createSlice({

Loading…
Cancel
Save