parent
2dc3c8cd3c
commit
9af7cf19da
3 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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}
|
||||
>
|
||||
<FaTrash /> Remove
|
||||
</CtxMenuItem>
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue