Adding support for text/select options in Prompt command

This commit is contained in:
Phil
2022-01-30 14:06:18 +00:00
parent 9ddb1c4379
commit 08d0b4cbae
3 changed files with 140 additions and 19 deletions

View File

@@ -649,7 +649,7 @@ export function Root(props: IProps): React.ReactElement {
if (serverScriptIndex === -1 || savedScriptCode !== server.scripts[serverScriptIndex as number].code) {
PromptEvent.emit({
txt: "Do you want to save changes to " + closingScript.fileName + "?",
resolve: (result: boolean) => {
resolve: (result: boolean | string) => {
if (result) {
// Save changes
closingScript.code = savedScriptCode;
@@ -704,7 +704,7 @@ export function Root(props: IProps): React.ReactElement {
PromptEvent.emit({
txt: "Do you want to overwrite the current editor content with the contents of " +
openScript.fileName + " on the server? This cannot be undone.",
resolve: (result: boolean) => {
resolve: (result: boolean | string) => {
if (result) {
// Save changes
openScript.code = serverScriptCode;