Skip to content

Commit e1d0a2f

Browse files
authored
Refactor show devMenu command (#2242)
* Refactor show devMenu command * Refactor reload command
1 parent 1bdb1e3 commit e1d0a2f

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

src/extension/commands/reloadApp.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ export class ReloadApp extends Command {
1717
);
1818

1919
async baseFn(): Promise<void> {
20-
await this.reloadApp();
21-
}
22-
public async reloadApp(): Promise<void> {
2320
assert(this.project);
2421
await sendMessageToMetro("reload", this.project);
2522
}

src/extension/commands/showDevMenu.ts

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import * as assert from "assert";
55
import * as nls from "vscode-nls";
66
import { ErrorHelper } from "../../common/error/errorHelper";
77
import { InternalErrorCode } from "../../common/error/internalErrorCode";
8-
import { PlatformType } from "../launchArgs";
9-
import { AndroidPlatform } from "../android/androidPlatform";
10-
import { IOSPlatform } from "../ios/iOSPlatform";
11-
import { getRunOptions } from "./util";
8+
import { sendMessageToMetro } from "./util";
129
import { Command } from "./util/command";
1310

1411
nls.config({
@@ -28,25 +25,6 @@ export class ShowDevMenu extends Command {
2825

2926
async baseFn(): Promise<void> {
3027
assert(this.project);
31-
32-
const androidPlatform = new AndroidPlatform(
33-
getRunOptions(this.project, PlatformType.Android),
34-
{
35-
packager: this.project.getPackager(),
36-
},
37-
) as AndroidPlatform;
38-
39-
androidPlatform.showDevMenu().catch(() => {});
40-
41-
if (process.platform === "darwin") {
42-
const iosPlatform = new IOSPlatform(getRunOptions(this.project, PlatformType.iOS), {
43-
packager: this.project.getPackager(),
44-
});
45-
46-
iosPlatform.showDevMenu(this.project).catch(() => {});
47-
}
48-
if (process.platform === "win32") {
49-
// TODO: implement Show DevMenu command for RNW
50-
}
28+
await sendMessageToMetro("devMenu", this.project);
5129
}
5230
}

0 commit comments

Comments
 (0)