mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-04 07:55:28 +00:00
Add flag to state indicating when skin is loaded
This commit is contained in:
parent
e3b5031f29
commit
1a7be6bce7
2 changed files with 8 additions and 2 deletions
|
|
@ -3,7 +3,12 @@ import { createStore, applyMiddleware } from "redux";
|
|||
import { composeWithDevTools } from "redux-devtools-extension";
|
||||
import thunk from "redux-thunk";
|
||||
|
||||
const defaultState = { makiTree: null, volume: 127, xmlTree: null };
|
||||
const defaultState = {
|
||||
makiTree: null,
|
||||
volume: 127,
|
||||
xmlTree: null,
|
||||
skinLoaded: false,
|
||||
};
|
||||
|
||||
function reducer(
|
||||
state: ModernAppState = defaultState,
|
||||
|
|
@ -11,7 +16,7 @@ function reducer(
|
|||
): ModernAppState {
|
||||
switch (action.type) {
|
||||
case "SET_MAKI_TREE":
|
||||
return { ...state, makiTree: action.makiTree };
|
||||
return { ...state, makiTree: action.makiTree, skinLoaded: true };
|
||||
case "SET_XML_TREE":
|
||||
return { ...state, xmlTree: action.xmlTree };
|
||||
case "SET_VOLUME":
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ export type ModernAppState = {
|
|||
makiTree: MakiTree | null;
|
||||
xmlTree: XmlTree | null;
|
||||
volume: number;
|
||||
skinLoaded: boolean;
|
||||
};
|
||||
export type ModernAction =
|
||||
| { type: "SET_MAKI_TREE"; makiTree: MakiTree }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue