# Ошибка с GIF в чате?

**URL:** <https://meta.discourse.org/t/gif-bug-in-chat/288369>\
**Category:** Bug\
**Tags:** chat, gifs\
**Created:** [12.Декабрь.2023 12:05:24 UTC](https://meta.discourse.org/t/gif-bug-in-chat/288369 "2023-12-12T12:05:24Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [17.Декабрь.2023 21:35:12 UTC](https://meta.discourse.org/t/gif-bug-in-chat/288369/9 "2023-12-17T21:35:12Z")

</div>

Я сделал PR 👍

> <https://github.com/discourse/discourse-gifs/pull/60>
>
> Meta: https://meta.discourse.org/t/gif-bug-in-chat/288369/5?u=arkshine
> 
> Follow…up 9607c7afafa6c470dd2ba184d19344524259ddc9.
> 
> Opening the GIF modal from the chat results in this error:
> !\[image\](https://github.com/discourse/discourse-gifs/assets/360640/5d0c8a52-6df5-485b-bb6f-9e97e1aa6408)
> 
> This is because \`modal: service()\` has been added here:
> 
> \`\`\`js
> api.modifyClass("component:chat-composer", {
> pluginId: "discourse-gifs",
> 
> modal: service(),
> 
> @action
> showChatGifModal(context) {
> this.modal.show(GifModal, {
> \`\`\`
> However, \`ChatComposer\` base \[class\](https://github.com/discourse/discourse/blob/main/plugins/chat/assets/javascripts/discourse/components/chat-composer.js#L44) already has the service. 
> This breaks inheritance with \`ChatComposerChannel\` \[child class\](https://github.com/discourse/discourse/blob/main/plugins/chat/assets/javascripts/discourse/components/chat/composer/channel.js), making \`this.modal\` unavailable when \`showChatGifModal\` is called.
> 
> As a solution, \`modal: service(),\` is removed.
> Result after the fix:
> 
> !\[image\](https://github.com/discourse/discourse-gifs/assets/360640/9fdd6318-fb36-49e5-b935-3ef557cf1989)

---

_[View the full topic](https://meta.discourse.org/t/gif-bug-in-chat/288369)._
