Skip to content

🎥 Make videos programmatically with React

Show notification when timeline code save rolls back

Jonny Burger4957ff2ff796
diff --git a/packages/studio/src/components/Timeline/TimelineEffectFieldRow.tsx b/packages/studio/src/components/Timeline/TimelineEffectFieldRow.tsx
index 5d0dfb3ab4..e531abbd52 100644
--- a/packages/studio/src/components/Timeline/TimelineEffectFieldRow.tsx
+++ b/packages/studio/src/components/Timeline/TimelineEffectFieldRow.tsx
@@ -10,6 +10,7 @@ import type {CodePosition} from '../../error-overlay/react-overlay/utils/get-sou
import type {EffectSchemaFieldInfo} from '../../helpers/timeline-layout';
import {EXPANDED_SECTION_PADDING_RIGHT} from '../../helpers/timeline-layout';
import {callApi} from '../call-api';
+import {showNotification} from '../Notifications/NotificationCenter';
import {Padder} from './Padder';
import {
TimelineFieldValue,
@@ -148,7 +149,7 @@ const Value: React.FC<{
return {...prev, effects: next};
});
})
- .catch(() => {
+ .catch((err) => {
setCodeValues(nodePath, (current) => {
if (previousUpdate) {
return previousUpdate;
@@ -156,6 +157,13 @@ const Value: React.FC<{
return current;
});
+ showNotification(
+ `Could not save effect prop: ${
+ err instanceof Error ? err.message : String(err)
+ }`,
+ 4000,
+ );
+ throw err;
});
},
[
diff --git a/packages/studio/src/components/Timeline/TimelineFieldRow.tsx b/packages/studio/src/components/Timeline/TimelineFieldRow.tsx
index 7ffff7402c..d9ca654286 100644
--- a/packages/studio/src/components/Timeline/TimelineFieldRow.tsx
+++ b/packages/studio/src/components/Timeline/TimelineFieldRow.tsx
@@ -15,6 +15,7 @@ import type {
} from '../../helpers/timeline-layout';
import {EXPANDED_SECTION_PADDING_RIGHT} from '../../helpers/timeline-layout';
import {callApi} from '../call-api';
+import {showNotification} from '../Notifications/NotificationCenter';
import {Padder} from './Padder';
import {
TimelineFieldValue,
@@ -128,7 +129,7 @@ const Value: React.FC<{
};
});
})
- .catch(() => {
+ .catch((err) => {
// In case something went wrong, undo optimistic update
setCodeValues(nodePath, (current) => {
if (previousUpdate) {
@@ -137,6 +138,13 @@ const Value: React.FC<{
return current;
});
+ showNotification(
+ `Could not save sequence prop: ${
+ err instanceof Error ? err.message : String(err)
+ }`,
+ 4000,
+ );
+ throw err;
});
},
[