Skip to content

Commit 8e8313d

Browse files
committed
send local file to frontend when modal cancelled
1 parent f196674 commit 8e8313d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/utils/editor.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import * as vscode from "vscode";
22
import * as os from "os";
33

44
import config from "../utils/config";
5-
import { VscWorkspaceLocation } from "./messages";
5+
import Messages, { VscWorkspaceLocation } from "./messages";
66
import path from "path";
7+
import { sendToFrontendWrapped } from "../commands/showPanel";
78

89
export class Editor {
910
editor?: vscode.TextEditor;
@@ -98,6 +99,13 @@ export class Editor {
9899
uri,
99100
new TextEncoder().encode(contents),
100101
);
102+
} else if (answer === undefined) {
103+
// Modal cancelled
104+
const message = Messages.Text(
105+
self.workspaceLocation,
106+
value.toString(),
107+
);
108+
sendToFrontendWrapped(message);
101109
}
102110
});
103111
}

0 commit comments

Comments
 (0)