@braze/web-sdk
Version:
Braze SDK for web sites and other JS platforms.
16 lines (15 loc) • 539 B
JavaScript
import je from "../in-app-message-manager-factory.js";
import r from "../../managers/braze-instance.js";
import { setupInAppMessageUI as rs } from "../../ui/js/index.js";
import { showInAppMessage } from "./show-in-app-message.js";
import { subscribeToInAppMessage } from "../subscribe-to-in-app-message.js";
export function automaticallyShowInAppMessages() {
if (!r.rr()) return;
rs();
const s = je.ra();
if (null == s.Gn()) {
const r = subscribeToInAppMessage((s) => showInAppMessage(s));
s.Nn(r);
}
return s.Gn();
}