Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-42385] Set title to popout window #19

Merged
merged 2 commits into from Mar 10, 2022
Merged

[MM-42385] Set title to popout window #19

merged 2 commits into from Mar 10, 2022

Conversation

streamer45
Copy link
Contributor

Summary

PR sets a more descriptive title to the pop-out window to be more easily identifiable.
Title format is Call - $channel_display_name. In case of DM, the username of the other participant is used instead.

/cc @aaronrothschild

Ticket Link

https://mattermost.atlassian.net/browse/MM-42385

@streamer45 streamer45 added the 2: Dev Review Requires review by a core committer label Mar 9, 2022
@streamer45 streamer45 requested a review from cpoile March 9, 2022 18:11
@streamer45 streamer45 self-assigned this Mar 9, 2022
const otherID = getUserIdFromDM(channel.name, getCurrentUserId(store.getState()));
const dmUser = getUser(store.getState(), otherID);
if (!dmUser) {
await getProfilesByIdsAction([otherID])(store.dispatch as any, store.getState);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of using any but I hit this issue before and my still fairly limited Typescript/React knowledge couldn't get to an easy solution.

Error was the following:

src/index.tsx:438:61 - error TS2345: Argument of type 'Dispatch<AnyAction>' is not assignable to parameter of type 'DispatchFunc'.
  Types of parameters 'action' and 'action' are incompatible.
    Type 'Action' is not assignable to type 'AnyAction'.
      Property 'type' is missing in type 'ActionFunc' but required in type 'AnyAction'.

438                     await getProfilesByIdsAction([otherID])(store.dispatch, store.getState);
                                                                ~~~~~~~~~~~~~~

  node_modules/redux/index.d.ts:19:3
    19   type: T
         ~~~~
    'type' is declared here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind if I push a commit? It will add redux-thunk to the dev dependencies and simplify this a bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By all means 🙌

Copy link
Member

@cpoile cpoile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@streamer45 streamer45 added 3: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Mar 10, 2022
@streamer45 streamer45 merged commit 4d14a07 into main Mar 10, 2022
@streamer45 streamer45 deleted the MM-42385 branch March 10, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants