Merge pull request #20934 from GuiLeme/data-channel-quick-fix

fix: fix useDataChannel subscribe events
This commit is contained in:
Anton Georgiev 2024-09-10 11:26:10 -04:00 committed by GitHub
commit a56ebfb2c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View File

@ -37,7 +37,6 @@ export const DataChannelItemManager: React.ElementType<DataChannelItemManagerPro
pluginName,
channelName,
pluginApi,
dataChannelTypes,
subChannelName,
dataChannelIdentifier,
}}

View File

@ -38,7 +38,7 @@ const PluginDataChannelManager: React.ElementType<PluginDataChannelManagerProps>
let newArrayTypes: DataChannelTypes[] = previousMap.get(uniqueId)?.types || [];
if (deltaSubscribe < 0) {
const index = newArrayTypes.indexOf(dataChannelType);
if (index > -1) {
if (index > 0) {
newArrayTypes.splice(index, 1);
}
} else {