-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Bug Report: Runtime Error in tawkSwitchWidget
Summary
A critical issue was identified in the TawkMessenger component that can cause a runtime error when calling tawkSwitchWidget.
Issue Details
Parameter mismatch in tawkSwitchWidget method
- Location:
useImperativeHandle, line 144 - Method:
tawkSwitchWidget
Current Implementation
tawkSwitchWidget: (options, callback) => {
window.Tawk_API.switchWidget(data, callback);
}Problem
The variable data is referenced but never defined within the scope of this method. This results in undefined being passed to switchWidget, causing a runtime error.
Based on the method signature, options is clearly intended to be passed instead.
Expected Behavior
The options parameter should be forwarded to window.Tawk_API.switchWidget.
Suggested Fix
tawkSwitchWidget: (options, callback) => {
window.Tawk_API.switchWidget(options, callback);
}Impact
- Causes runtime errors when
tawkSwitchWidgetis invoked - Breaks widget switching functionality
- Can crash consumer applications depending on error handling
Metadata
Metadata
Assignees
Labels
No labels