Fix rendering of 3rd party emotes in : autocomplete tray
Twitch recently changed how they render the emotes in the autocomplete tray. The renderEmoteSuggestion is no longer called, so we need to override the srcSet elsewhere. Seems to be working when overriding the getMatches.
This appears to remove the provider indicators in colon completion. (Perhaps because the code block which handled this has been removed for some reason?)
The best solution i could find was editing the srcSet in the getMatches function. And there i only had access to the react element. I dont know what the provider indicators are supposed to do, but couldnt find anything to "update" in the element accordingly.
current: ":4Hea"
element: Array(2)
0: {$$typeof: Symbol(react.element), type: {…}, key: 'emote-img-354', ref: null, props: {…}, …}
1: {$$typeof: Symbol(react.element), type: {…}, key: 'emote-text-354', ref: null, props: {…}, …}
length: 2
[[Prototype]]: Array(0)
replacement: "4Head"
type: "emote"
It added information about where any given emote came from, i.e Kappa (Twitch Global) or GIGACHAD (Channel 7TV)
It added information about where any given emote came from, i.e
Kappa (Twitch Global)orGIGACHAD (Channel 7TV)
Does twitch do that by default? We could alternatively just add edit the displayed text
It added information about where any given emote came from, i.e
Kappa (Twitch Global)orGIGACHAD (Channel 7TV)Does twitch do that by default?
No. This is something I added, you can see it in the code block you removed in this PR
It added information about where any given emote came from, i.e
Kappa (Twitch Global)orGIGACHAD (Channel 7TV)Does twitch do that by default? We could alternatively just add edit the displayed text
Seems like provider isnt available in the scope of this function making it difficult to add it to the name. We could get the id and then find it by iteration over all of the emote sets, but dont think that would be a good solution
It added information about where any given emote came from, i.e
Kappa (Twitch Global)orGIGACHAD (Channel 7TV)Does twitch do that by default? We could alternatively just add edit the displayed text
Seems like
providerisnt available in the scope of this function
That's because it was added to the emote objects. Remember all objects in JavaScript are pointers.
It added information about where any given emote came from, i.e
Kappa (Twitch Global)orGIGACHAD (Channel 7TV)Does twitch do that by default? We could alternatively just add edit the displayed text
Seems like
providerisnt available in the scope of this functionThat's because it was added to the emote objects. Remember all objects in JavaScript are pointers.
Yea, was just stating that we dont have access the provider of the emote element that is returned to us. So that we'd have to resolve the emote again from using the id if we want to find the provider.
It added information about where any given emote came from, i.e
Kappa (Twitch Global)orGIGACHAD (Channel 7TV)Does twitch do that by default? We could alternatively just add edit the displayed text
Seems like
providerisnt available in the scope of this functionThat's because it was added to the emote objects. Remember all objects in JavaScript are pointers.
Yea, was just stating that we dont have access the provider of the emote element that is returned to us. So that we'd have to resolve the emote again from using the id if we want to find the provider.
Oh, so Twitch changed something. Then yeah I guess that's the only way to reinstate this feature