diff --git a/src/showplanner/Item.tsx b/src/showplanner/Item.tsx index b4dde60..572de8c 100644 --- a/src/showplanner/Item.tsx +++ b/src/showplanner/Item.tsx @@ -38,6 +38,10 @@ export const Item = memo(function Item({ const id = itemId(x); const isGhost = "ghostid" in x; + const planSaving = useSelector( + (state: RootState) => state.showplan.planSaving + ); + const loadedItem = useSelector( (state: RootState) => column > -1 ? state.mixer.players[column]?.loadedItem : null, @@ -183,7 +187,7 @@ export const Item = memo(function Item({ return data.join("¬"); // Something obscure to split against. } - let isDragDisabled = isGhost; + let isDragDisabled = isGhost || planSaving; if (!process.env.REACT_APP_BAPSICLE_INTERFACE) { isDragDisabled = isDragDisabled || isLoaded; diff --git a/src/showplanner/index.tsx b/src/showplanner/index.tsx index b5a343d..03332fd 100644 --- a/src/showplanner/index.tsx +++ b/src/showplanner/index.tsx @@ -100,6 +100,9 @@ const Showplanner: React.FC<{ timeslotId: number | null }> = function({ (state: RootState) => state.showplan.plan !== null, shallowEqual ); + const planSaving = useSelector( + (state: RootState) => state.showplan.planSaving + ); // Tell Modals that #root is the main page content, for accessability reasons. Modal.setAppElement("#root"); @@ -239,6 +242,7 @@ const Showplanner: React.FC<{ timeslotId: number | null }> = function({ onClick={(args) => dispatch(removeItem(timeslotId!, (args.props as any).id)) } + disabled={planSaving} > Remove diff --git a/src/showplanner/state.ts b/src/showplanner/state.ts index 2bf828d..3c6b8e7 100644 --- a/src/showplanner/state.ts +++ b/src/showplanner/state.ts @@ -682,7 +682,7 @@ export const getShowplan = (timeslotId: number): AppThunk => async ( dispatch(showplan.actions.getShowplanSuccess(plan.flat(2))); } catch (e) { console.error(e); - dispatch(showplan.actions.getShowplanError(e.toString())); + dispatch(showplan.actions.getShowplanError(String(e))); } };