diff --git a/.github/workflows/issue_closed.yaml b/.github/workflows/issue_closed.yaml index 5e32442f7..c4daabf65 100644 --- a/.github/workflows/issue_closed.yaml +++ b/.github/workflows/issue_closed.yaml @@ -17,33 +17,3 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} NUMBER: ${{ github.event.issue.number }} - - name: Set project ID - run: | - echo "PROJECT_ID=PVT_kwDOBndSo84A7FWL" >> $GITHUB_ENV - - name: Get item ID for issue in project - id: get_item_id - run: | - ITEM_ID=$(gh api graphql -f query='query { repository(owner: "${{ github.repository_owner }}", name: "${{ github.event.repository.name }}") { issue(number: ${{ github.event.issue.number }}) { projectItems(first: 10) { nodes { id project { id } } } } }' --jq '.data.repository.issue.projectItems.nodes[] | select(.project.id==env.PROJECT_ID) | .id') - echo "ITEM_ID=$ITEM_ID" >> $GITHUB_ENV - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Get status field and Done option IDs - id: get_status_ids - run: | - STATUS_FIELD_ID=$(gh api graphql -f query='query { node(id: "'$PROJECT_ID'") { ... on ProjectV2 { fields(first: 20) { nodes { id name } } } } }' --jq '.data.node.fields.nodes[] | select(.name=="Status") | .id') - DONE_OPTION_ID=$(gh api graphql -f query='query { node(id: "'$STATUS_FIELD_ID'") { ... on ProjectV2Field { options { id name } } } }' --jq '.data.node.options[] | select(.name=="Done") | .id') - echo "STATUS_FIELD_ID=$STATUS_FIELD_ID" >> $GITHUB_ENV - echo "DONE_OPTION_ID=$DONE_OPTION_ID" >> $GITHUB_ENV - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Set status to Done in project - run: | - gh api graphql -f query='mutation($project:ID!, $item:ID!, $field:ID!, $option:ID!) { updateProjectV2ItemFieldValue(input: {projectId: $project, itemId: $item, fieldId: $field, value: { singleSelectOptionId: $option } }) { projectV2Item { id } } }' -f project=$PROJECT_ID -f item=$ITEM_ID -f field=$STATUS_FIELD_ID -f option=$DONE_OPTION_ID - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PROJECT_ID: ${{ env.PROJECT_ID }} - ITEM_ID: ${{ env.ITEM_ID }} - STATUS_FIELD_ID: ${{ env.STATUS_FIELD_ID }} - DONE_OPTION_ID: ${{ env.DONE_OPTION_ID }} -# To get your project, field, and option IDs, see the instructions in the new issue_opened_project.yaml file. -# You must replace the placeholders with your actual project and field IDs. diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index eadf2cb21..185753e49 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -61,24 +61,25 @@ class LoginController extends State { // TODO: implement initState super.initState(); loadingSignIn = true; - pangeaController.checkHomeServerAction().then((value) { - setState(() { - loadingSignIn = false; - }); + pangeaController.checkHomeServerAction().then((client) { + if (mounted) { + setState(() { + loadingSignIn = false; + this.client = client; + }); + } }).catchError((e) { final String err = e.toString(); - setState(() { - loadingSignIn = false; - passwordError = err.toLocalizedString(context); - }); + if (mounted) { + setState(() { + loadingSignIn = false; + passwordError = err.toLocalizedString(context); + }); + } }); usernameController.addListener(() => setState(() {})); passwordController.addListener(() => setState(() {})); - - Matrix.of(context).getLoginClient().then((client) { - if (mounted) setState(() => this.client = client); - }); } @override diff --git a/lib/pangea/activity_sessions/activity_room_extension.dart b/lib/pangea/activity_sessions/activity_room_extension.dart index d4b45d056..5af6879dd 100644 --- a/lib/pangea/activity_sessions/activity_room_extension.dart +++ b/lib/pangea/activity_sessions/activity_room_extension.dart @@ -276,6 +276,7 @@ extension ActivityRoomExtension on Room { activityResults: messages, contentFeedback: [], analytics: analytics, + roleState: activityRoles, ), ); diff --git a/lib/pangea/activity_sessions/activity_session_chat/activity_stats_button.dart b/lib/pangea/activity_sessions/activity_session_chat/activity_stats_button.dart index 21d6c99cf..512ba8242 100644 --- a/lib/pangea/activity_sessions/activity_session_chat/activity_stats_button.dart +++ b/lib/pangea/activity_sessions/activity_session_chat/activity_stats_button.dart @@ -225,7 +225,7 @@ class _ActivityStatsButtonState extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ _StatsBadge( - icon: Icons.radar, + icon: Icons.star, value: "$_xpCount XP", ), _StatsBadge( diff --git a/lib/pangea/activity_summary/activity_summary_request_model.dart b/lib/pangea/activity_summary/activity_summary_request_model.dart index 7ca143565..0334be896 100644 --- a/lib/pangea/activity_summary/activity_summary_request_model.dart +++ b/lib/pangea/activity_summary/activity_summary_request_model.dart @@ -1,6 +1,7 @@ // Add this import for the participant summary model import 'package:fluffychat/pangea/activity_planner/activity_plan_model.dart'; +import 'package:fluffychat/pangea/activity_sessions/activity_roles_model.dart'; import 'package:fluffychat/pangea/activity_summary/activity_summary_analytics_model.dart'; import 'package:fluffychat/pangea/activity_summary/activity_summary_response_model.dart'; @@ -66,6 +67,7 @@ class ContentFeedbackModel { class ActivitySummaryRequestModel { final ActivityPlanModel activity; + final ActivityRolesModel? roleState; final List activityResults; final List contentFeedback; final ActivitySummaryAnalyticsModel analytics; @@ -75,6 +77,7 @@ class ActivitySummaryRequestModel { required this.activityResults, required this.contentFeedback, required this.analytics, + this.roleState, }); Map toJson() { @@ -83,6 +86,7 @@ class ActivitySummaryRequestModel { 'activity_results': activityResults.map((e) => e.toJson()).toList(), 'content_feedback': contentFeedback.map((e) => e.toJson()).toList(), 'analytics': analytics.toJson(), + 'role_state': roleState?.toJson() ?? {}, }; } } diff --git a/lib/pangea/chat_list/utils/chat_list_handle_space_tap.dart b/lib/pangea/chat_list/utils/chat_list_handle_space_tap.dart index 348e3afcf..3557806d5 100644 --- a/lib/pangea/chat_list/utils/chat_list_handle_space_tap.dart +++ b/lib/pangea/chat_list/utils/chat_list_handle_space_tap.dart @@ -50,7 +50,9 @@ void chatListHandleSpaceTap( Room space, ) { void setActiveSpaceAndCloseChat() { - context.go("/rooms/spaces/${space.id}/details"); + // push to refresh space details + // https://github.com/pangeachat/client/issues/4292#issuecomment-3426794043 + context.push("/rooms/spaces/${space.id}/details"); } void autoJoin(Room space) { diff --git a/lib/pangea/common/controllers/pangea_controller.dart b/lib/pangea/common/controllers/pangea_controller.dart index 2f3194917..fd01ea217 100644 --- a/lib/pangea/common/controllers/pangea_controller.dart +++ b/lib/pangea/common/controllers/pangea_controller.dart @@ -142,11 +142,11 @@ class PangeaController { await Future.wait(futures); } - Future checkHomeServerAction() async { + Future checkHomeServerAction() async { final client = await matrixState.getLoginClient(); if (client.homeserver != null) { await Future.delayed(Duration.zero); - return; + return client; } final String homeServer = @@ -163,8 +163,7 @@ class PangeaController { matrixState.loginRegistrationSupported = e.requireAdditionalAuthentication; } - - // setState(() => error = (e).toLocalizedString(context)); + return client; } /// check user information if not found then redirect to Date of birth page diff --git a/lib/widgets/matrix.dart b/lib/widgets/matrix.dart index 8b053c7fb..4a1512833 100644 --- a/lib/widgets/matrix.dart +++ b/lib/widgets/matrix.dart @@ -199,6 +199,12 @@ class MatrixState extends State with WidgetsBindingObserver { }); // #Pangea candidate.homeserver = Uri.parse("https://${AppConfig.defaultHomeserver}"); + + // This listener is not set for the new login client until the user is logged in, + // but if the user tries to sign up without this listener set, the signup UIA request + // will hang. So set the listener here. + onUiaRequest[candidate.clientName] ??= + candidate.onUiaRequest.stream.listen(uiaRequestHandler); // Pangea# if (widget.clients.isEmpty) widget.clients.add(candidate); return candidate; @@ -411,6 +417,10 @@ class MatrixState extends State with WidgetsBindingObserver { onLoginStateChanged.remove(name); onNotification[name]?.cancel(); onNotification.remove(name); + // #Pangea + onUiaRequest[name]?.cancel(); + onUiaRequest.remove(name); + // Pangea# } void initMatrix() {