Don't close submission menu if submission didn't go through

Fxies submission menu closing for warning about previewing a segment
This commit is contained in:
Ajay
2024-02-01 13:31:19 -05:00
parent c0bc068a18
commit e0fe0fad67
3 changed files with 16 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ export interface SubmissionNoticeProps {
// Contains functions and variables from the content script needed by the skip notice
contentContainer: ContentContainer;
callback: () => unknown;
callback: () => Promise<boolean>;
closeListener: () => void;
}
@@ -239,9 +239,11 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
}
}
this.props.callback();
this.cancel();
this.props.callback().then((success) => {
if (success) {
this.cancel();
}
});
}
sortSegments(): void {