Skip to content

Commit

Permalink
Don't push in undo stack the individual changes made in a modal with …
Browse files Browse the repository at this point in the history
…a cancel button
  • Loading branch information
mthh committed Oct 7, 2024
1 parent a7c71d9 commit 22dda1e
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 77 deletions.
23 changes: 10 additions & 13 deletions src/components/Modals/LayerSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ import {
// the changes to the undo/redo stack (because there is a
// cancel button in the LayerSettings modal)
setLayersDescriptionStoreBase,
// Except for the layoutFeaturesAndLegends, where we want to push the changes
// through the undo/redo stack
setLayersDescriptionStore,
updateProp,
debouncedUpdateProp,
} from '../../store/LayersDescriptionStore';
Expand Down Expand Up @@ -989,7 +986,7 @@ function makeSettingsDefaultPoint(
onChange={(v) => {
const legendPosition = getPossibleLegendPosition(300, 250);

setLayersDescriptionStore(
setLayersDescriptionStoreBase(
produce(
(draft: LayersDescriptionStoreType) => {
draft.layoutFeaturesAndLegends.push({
Expand Down Expand Up @@ -1042,7 +1039,7 @@ function makeSettingsDefaultPoint(
onChange={(v) => {
const legendPosition = getPossibleLegendPosition(300, 250);

setLayersDescriptionStore(
setLayersDescriptionStoreBase(
produce(
(draft: LayersDescriptionStoreType) => {
draft.layoutFeaturesAndLegends.push({
Expand Down Expand Up @@ -1097,7 +1094,7 @@ function makeSettingsDefaultPoint(
onChange={(v) => {
const legendPosition = getPossibleLegendPosition(300, 250);

setLayersDescriptionStore(
setLayersDescriptionStoreBase(
produce(
(draft: LayersDescriptionStoreType) => {
draft.layoutFeaturesAndLegends.push({
Expand Down Expand Up @@ -1151,7 +1148,7 @@ function makeSettingsDefaultPoint(
onChange={(v) => {
const legendPosition = getPossibleLegendPosition(300, 250);

setLayersDescriptionStore(
setLayersDescriptionStoreBase(
produce(
(draft: LayersDescriptionStoreType) => {
draft.layoutFeaturesAndLegends.push({
Expand Down Expand Up @@ -1597,7 +1594,7 @@ function makeSettingsDefaultLine(
onChange={(v) => {
const legendPosition = getPossibleLegendPosition(300, 250);

setLayersDescriptionStore(
setLayersDescriptionStoreBase(
produce(
(draft: LayersDescriptionStoreType) => {
draft.layoutFeaturesAndLegends.push({
Expand Down Expand Up @@ -1650,7 +1647,7 @@ function makeSettingsDefaultLine(
onChange={(v) => {
const legendPosition = getPossibleLegendPosition(300, 250);

setLayersDescriptionStore(
setLayersDescriptionStoreBase(
produce(
(draft: LayersDescriptionStoreType) => {
draft.layoutFeaturesAndLegends.push({
Expand Down Expand Up @@ -1703,7 +1700,7 @@ function makeSettingsDefaultLine(
onChange={(v) => {
const legendPosition = getPossibleLegendPosition(300, 250);

setLayersDescriptionStore(
setLayersDescriptionStoreBase(
produce(
(draft: LayersDescriptionStoreType) => {
draft.layoutFeaturesAndLegends.push({
Expand Down Expand Up @@ -1759,7 +1756,7 @@ function makeSettingsDefaultLine(
onChange={(v) => {
const legendPosition = getPossibleLegendPosition(300, 250);

setLayersDescriptionStore(
setLayersDescriptionStoreBase(
produce(
(draft: LayersDescriptionStoreType) => {
draft.layoutFeaturesAndLegends.push({
Expand Down Expand Up @@ -1965,7 +1962,7 @@ function makeSettingsDefaultPolygon(
onChange={(v) => {
const legendPosition = getPossibleLegendPosition(300, 250);

setLayersDescriptionStore(
setLayersDescriptionStoreBase(
produce(
(draft: LayersDescriptionStoreType) => {
draft.layoutFeaturesAndLegends.push({
Expand Down Expand Up @@ -2015,7 +2012,7 @@ function makeSettingsDefaultPolygon(
onChange={(v) => {
const legendPosition = getPossibleLegendPosition(300, 250);

setLayersDescriptionStore(
setLayersDescriptionStoreBase(
produce(
(draft: LayersDescriptionStoreType) => {
draft.layoutFeaturesAndLegends.push({
Expand Down
Loading

0 comments on commit 22dda1e

Please sign in to comment.