From 662b5081611a140e350dddb3a357f7be392f1ee9 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Wed, 17 Nov 2021 23:49:26 -0800 Subject: [PATCH] Add serverType to config store --- src/__tests__/App.test.tsx | 2 ++ src/redux/configSlice.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/__tests__/App.test.tsx b/src/__tests__/App.test.tsx index 7e762c3..4e2d121 100644 --- a/src/__tests__/App.test.tsx +++ b/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, any, Dispatch>[] | undefined = []; const mockStore = configureMockStore(middlewares); @@ -115,6 +116,7 @@ const configState: ConfigPage = { filters: [], }, sort: {}, + serverType: Server.Subsonic, lookAndFeel: { listView: { music: { diff --git a/src/redux/configSlice.ts b/src/redux/configSlice.ts index 45272ef..6d58a59 100644 --- a/src/redux/configSlice.ts +++ b/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({