File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 BotInfo ,
88 ExtraOptions ,
99 PlayerJs ,
10+ Result ,
1011 type StartMatchOptions ,
1112} from " ../../bindings/gui/index.js" ;
1213import arenaImages from " ../arena-images" ;
@@ -318,7 +319,8 @@ async function onMatchStart(randomizeMap: boolean) {
318319 ];
319320 }
320321
321- function playerMap(draggable : DraggablePlayer ): PlayerJs {
322+ // this syntax makes more sense when inside of another function
323+ const playerMap = (draggable : DraggablePlayer ): PlayerJs => {
322324 let clone = { ... draggable };
323325 if (clone .player instanceof BotInfo ) {
324326 clone .player = BotInfo .createFrom (structuredClone (clone .player ));
@@ -352,7 +354,16 @@ async function onMatchStart(randomizeMap: boolean) {
352354 });
353355 startMatchToastId = toastId ;
354356
355- const response = await App .StartMatch (options );
357+ let response;
358+ try {
359+ response = await App .StartMatch (options );
360+ } catch (e ) {
361+ toast .error (` Match start failed\n ${e } ` , {
362+ id: toastId ,
363+ duration: 10000 ,
364+ });
365+ return ;
366+ }
356367
357368 if (toastId !== startMatchToastId ) return ;
358369 startMatchToastId = null ;
You can’t perform that action at this time.
0 commit comments