Skip to content

Commit

Permalink
Fix handling OBS_FRONTEND_EVENT_TRANSITION_CHANGED
Browse files Browse the repository at this point in the history
When handling frontend events, DispatchJSEvent expects JSON passed as a
std::string. An unquoted string is not valid JSON. To get valid JSON, we
can build a JSON object like in OBS_FRONTEND_EVENT_SCENE_CHANGED and
pass the result of dump() to DispatchJSEvent.
  • Loading branch information
RytoEX committed Dec 4, 2023
1 parent 36508a9 commit f877e55
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion obs-browser-plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,9 @@ static void handle_obs_frontend_event(enum obs_frontend_event event, void *)
if (!name)
break;

DispatchJSEvent("obsTransitionChanged", name);
nlohmann::json json = {{"name", name}};

DispatchJSEvent("obsTransitionChanged", json.dump());
break;
}
case OBS_FRONTEND_EVENT_TRANSITION_LIST_CHANGED: {
Expand Down

0 comments on commit f877e55

Please sign in to comment.