Skip to content

Commit

Permalink
Fix splash screen bugs
Browse files Browse the repository at this point in the history
If you use the menu bar to create or open a flow, it now hides the
splash screen.
  • Loading branch information
mehaase committed Aug 25, 2023
1 parent 6f5bb26 commit 654a443
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { AppCommand } from "../AppCommand";
import { ApplicationStore } from "@/store/StoreTypes";

export class GroupCommand extends AppCommand {

/**
* The list of commands in order of application.
*/
public readonly commands: ReadonlyArray<AppCommand>;

/**
* Executes a series of page commands.
* @param context
* The application context.
*/
constructor(context: ApplicationStore) {
super(context);
this.commands = [];
}

/**
* Adds a command to the group.
* @param command
* The command.
*/
public add(command: AppCommand) {
(this.commands as AppCommand[]).push(command);
}

/**
* Applies the set of commands.
*/
public execute(): void {
for(const command of this.commands) {
command.execute();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./ClearPageRecoveryBank";
export * from "./CopySelectedChildren";
export * from "./GroupCommand";
export * from "./HideSplashMenu";
export * from "./LoadFile";
export * from "./LoadSettings";
Expand Down
14 changes: 12 additions & 2 deletions src/attack_flow_builder/src/store/Stores/ContextMenuStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,23 @@ export default {
{
text: "New File",
type: MenuType.Item,
data: () => App.LoadFile.fromNew(ctx),
data: async () => {
const cmd = new App.GroupCommand(ctx);
cmd.add(await App.LoadFile.fromNew(ctx));
cmd.add(new App.HideSplashMenu(ctx));
return cmd;
},
shortcut: file.new_file,
},
{
text: `Open File...`,
type: MenuType.Item,
data: () => App.LoadFile.fromFileSystem(ctx),
data: async () => {
const cmd = new App.GroupCommand(ctx);
cmd.add(await App.LoadFile.fromFileSystem(ctx));
cmd.add(new App.HideSplashMenu(ctx));
return cmd;
},
shortcut: file.open_file,
}
],
Expand Down

0 comments on commit 654a443

Please sign in to comment.