File tree Expand file tree Collapse file tree 6 files changed +12
-42
lines changed
Expand file tree Collapse file tree 6 files changed +12
-42
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import Config, * as UpdateConfig from "../config";
22import { isAuthenticated } from "../firebase" ;
33import * as DB from "../db" ;
44import * as Notifications from "../elements/notifications" ;
5- import { getCommandline } from "../utils/async-modules " ;
5+ import * as Commandline from "../commandline/commandline " ;
66import * as SupportPopup from "../modals/support" ;
77import * as ContactModal from "../modals/contact" ;
88import * as VersionHistoryModal from "../modals/version-history" ;
@@ -11,7 +11,7 @@ import { envConfig } from "../constants/env-config";
1111document
1212 . querySelector ( "footer #commandLineMobileButton" )
1313 ?. addEventListener ( "click" , async ( ) => {
14- ( await getCommandline ( ) ) . show ( {
14+ Commandline . show ( {
1515 singleListOverride : false ,
1616 } ) ;
1717 } ) ;
@@ -54,7 +54,7 @@ document
5454 UpdateConfig . setCustomTheme ( true ) ;
5555 } else {
5656 const subgroup = Config . customTheme ? "customThemesList" : "themes" ;
57- ( await getCommandline ( ) ) . show ( {
57+ Commandline . show ( {
5858 subgroupOverride : subgroup ,
5959 } ) ;
6060 }
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import * as Misc from "../utils/misc";
22import * as PageTransition from "../states/page-transition" ;
33import Config from "../config" ;
44import * as TestWords from "../test/test-words" ;
5- import { getCommandline } from "../utils/async-modules " ;
5+ import * as Commandline from "../commandline/commandline " ;
66import * as Notifications from "../elements/notifications" ;
77
88document . addEventListener ( "keydown" , async ( e ) => {
@@ -24,7 +24,7 @@ document.addEventListener("keydown", async (e) => {
2424 e . preventDefault ( ) ;
2525 const popupVisible = Misc . isAnyPopupVisible ( ) ;
2626 if ( ! popupVisible ) {
27- ( await getCommandline ( ) ) . show ( ) ;
27+ Commandline . show ( ) ;
2828 }
2929 }
3030} ) ;
Original file line number Diff line number Diff line change 1- import { getCommandline } from "../utils/async-modules " ;
1+ import * as Commandline from "../commandline/commandline " ;
22
33$ ( "#keymap" ) . on ( "click" , ".r5 .layoutIndicator" , async ( ) => {
4- ( await getCommandline ( ) ) . show ( {
4+ Commandline . show ( {
55 subgroupOverride : "keymapLayouts" ,
66 } ) ;
77} ) ;
Original file line number Diff line number Diff line change 1- import { getCommandline } from "../utils/async-modules " ;
1+ import * as Commandline from "../commandline/commandline " ;
22import * as CustomWordAmount from "../modals/custom-word-amount" ;
33import Config from "../config" ;
44import * as DB from "../db" ;
@@ -18,13 +18,13 @@ import { getMode2 } from "../utils/misc";
1818$ ( ".pageTest" ) . on ( "click" , "#testModesNotice .textButton" , async ( event ) => {
1919 const attr = $ ( event . currentTarget ) . attr ( "commands" ) ;
2020 if ( attr === undefined ) return ;
21- ( await getCommandline ( ) ) . show ( { subgroupOverride : attr } ) ;
21+ Commandline . show ( { subgroupOverride : attr } ) ;
2222} ) ;
2323
2424$ ( ".pageTest" ) . on ( "click" , "#testModesNotice .textButton" , async ( event ) => {
2525 const attr = $ ( event . currentTarget ) . attr ( "commandId" ) ;
2626 if ( attr === undefined ) return ;
27- ( await getCommandline ( ) ) . show ( { commandOverride : attr } ) ;
27+ Commandline . show ( { commandOverride : attr } ) ;
2828} ) ;
2929
3030$ ( ".pageTest" ) . on ( "click" , "#testConfig .wordCount .textButton" , ( e ) => {
Original file line number Diff line number Diff line change 11import AnimatedModal from "../utils/animated-modal" ;
2- import { getCommandline } from "../utils/async-modules " ;
2+ import * as Commandline from "../commandline/commandline " ;
33
44export function show ( ) : void {
55 void modal . show ( ) ;
@@ -9,8 +9,7 @@ const modal = new AnimatedModal({
99 dialogId : "supportModal" ,
1010 setup : async ( modalEl ) : Promise < void > => {
1111 modalEl . querySelector ( "button.ads" ) ?. addEventListener ( "click" , async ( ) => {
12- const commandline = await getCommandline ( ) ;
13- commandline . show (
12+ Commandline . show (
1413 { subgroupOverride : "enableAds" } ,
1514 {
1615 modalChain : modal ,
Original file line number Diff line number Diff line change @@ -3,35 +3,6 @@ import * as Notifications from "../elements/notifications";
33import { createErrorMessage } from "./misc" ;
44import * as Skeleton from "../utils/skeleton" ;
55
6- Skeleton . save ( "commandLine" ) ;
7-
8- export async function getCommandline ( ) : Promise <
9- typeof import ( "../commandline/commandline.js" )
10- > {
11- try {
12- Loader . show ( ) ;
13- // eslint-disable-next-line import/no-unresolved
14- const module = await import ( "../commandline/commandline.js" ) ;
15- Loader . hide ( ) ;
16- return module ;
17- } catch ( e ) {
18- Loader . hide ( ) ;
19- if (
20- e instanceof Error &&
21- e . message . includes ( "Failed to fetch dynamically imported module" )
22- ) {
23- Notifications . add (
24- "Failed to load commandline module: could not fetch" ,
25- - 1
26- ) ;
27- } else {
28- const msg = createErrorMessage ( e , "Failed to load commandline module" ) ;
29- Notifications . add ( msg , - 1 ) ;
30- }
31- throw e ;
32- }
33- }
34-
356Skeleton . save ( "devOptionsModal" ) ;
367
378export async function getDevOptionsModal ( ) : Promise <
You can’t perform that action at this time.
0 commit comments