Skip to content

Commit

Permalink
removed goToContextLine
Browse files Browse the repository at this point in the history
set sdk in UserSharedExampleLoadingDescriptor
removed jsonDecode from temporary postUnitComplete
(apache#23692)
  • Loading branch information
darkhan.nausharipov committed Jan 6, 2023
1 parent dbcf032 commit d8b5c11
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
23 changes: 13 additions & 10 deletions learning/tour-of-beam/frontend/lib/pages/tour/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,19 @@ class TourNotifier extends ChangeNotifier with PageStateMixin<void> {
return;
}

await playgroundController.examplesLoader.load(
ExamplesLoadingDescriptor(
descriptors: [
UserSharedExampleLoadingDescriptor(
sdk: sdk,
snippetId: taskSnippetId,
),
],
),
);
final sdk = Sdk.tryParse(_appNotifier.sdkId);
if (sdk != null) {
await playgroundController.examplesLoader.load(
ExamplesLoadingDescriptor(
descriptors: [
UserSharedExampleLoadingDescriptor(
sdk: sdk,
snippetId: taskSnippetId,
),
],
),
);
}
}

// TODO(alexeyinkin): Hide the entire right pane instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class PlaygroundDemoWidget extends StatelessWidget {
first: SnippetEditor(
controller: snippetController,
isEditable: true,
goToContextLine: false,
),
second: OutputWidget(
playgroundController: playgroundController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,13 @@ class CloudFunctionsTobClient extends TobClient {
@override
Future<void> postUnitComplete(String sdkId, String id) async {
final token = await GetIt.instance.get<AuthNotifier>().getToken();
final json = await http.post(
await http.post(
Uri.parse(
'$cloudFunctionsBaseUrl/postUnitComplete?sdk=$sdkId&id=$id',
),
headers: {
HttpHeaders.authorizationHeader: 'Bearer $token',
},
);
final map = jsonDecode(utf8.decode(json.bodyBytes));
}
}

0 comments on commit d8b5c11

Please sign in to comment.