Skip to content

Commit

Permalink
Move DWDS launch event
Browse files Browse the repository at this point in the history
  • Loading branch information
elliette committed May 1, 2024
1 parent b41ac34 commit fb19262
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
14 changes: 0 additions & 14 deletions dwds/lib/dart_web_debug_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ class Dwds {
debugSettings.launchDevToolsInNewWindow,
);

_maybeEmitDwdsLaunchEvent(toolConfiguration);

return Dwds._(
injected.middleware,
devTools,
Expand All @@ -142,18 +140,6 @@ class Dwds {
);
}

static void _maybeEmitDwdsLaunchEvent(ToolConfiguration toolConfiguration) {
if (toolConfiguration.appMetadata.codeRunner != null) {
emitEvent(
DwdsEvent.dwdsLaunch(
codeRunner: toolConfiguration.appMetadata.codeRunner!,
isFlutterApp:
toolConfiguration.loadStrategy.buildSettings.isFlutterApp,
),
);
}
}

bool shouldPauseIsolatesOnStart(String appId) =>
_devHandler.shouldPauseIsolatesOnStart(appId);
}
16 changes: 16 additions & 0 deletions dwds/lib/src/handlers/dev_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ class DevHandler {
');',
},
);

// Notify that DWDS has been launched and a debug connection has been made:
_maybeEmitDwdsLaunchEvent();

return appDebugService;
}

Expand Down Expand Up @@ -695,6 +699,18 @@ class DevHandler {
);
}
}

static void _maybeEmitDwdsLaunchEvent() {
if (globalToolConfiguration.appMetadata.codeRunner != null) {
emitEvent(
DwdsEvent.dwdsLaunch(
codeRunner: globalToolConfiguration.appMetadata.codeRunner!,
isFlutterApp:
globalToolConfiguration.loadStrategy.buildSettings.isFlutterApp,
),
);
}
}
}

class AppConnectionException implements Exception {
Expand Down

0 comments on commit fb19262

Please sign in to comment.