Skip to content

Commit cfb5994

Browse files
committed
Add explanatory comment and make onSuccess mandatory but nullable
1 parent 7217502 commit cfb5994

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

packages/studio/src/components/InitialCompositionLoader.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ export const InitialCompositionLoader: React.FC = () => {
9494
const canvasContentFromUrl = deriveCanvasContentFromUrl();
9595

9696
if (canvasContent) {
97+
// If the URL points to a different composition than the one currently
98+
// displayed, switch to it. This handles the case where the URL is
99+
// updated externally (e.g. after duplicating a composition).
97100
if (
98101
canvasContentFromUrl &&
99102
canvasContentFromUrl.type === 'composition' &&

packages/studio/src/components/NewComposition/CodemodFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const CodemodFooter: React.FC<{
1818
readonly errorNotification: string;
1919
readonly genericSubmitLabel: string;
2020
readonly submitLabel: (options: {relativeRootPath: string}) => string;
21-
readonly onSuccess?: () => void;
21+
readonly onSuccess: (() => void) | null;
2222
}> = ({
2323
codemod,
2424
valid,

packages/studio/src/components/NewComposition/DeleteComposition.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const DeleteCompositionLoaded: React.FC<{
6565
}
6666
codemod={codemod}
6767
valid
68+
onSuccess={null}
6869
/>
6970
</ModalFooterContainer>
7071
</form>

packages/studio/src/components/NewComposition/RenameComposition.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const RenameCompositionLoaded: React.FC<{}> = () => {
104104
submitLabel={({relativeRootPath}) => `Modify ${relativeRootPath}`}
105105
codemod={codemod}
106106
valid={valid}
107+
onSuccess={null}
107108
/>
108109
</ModalFooterContainer>
109110
</form>

0 commit comments

Comments
 (0)