@braze/web-sdk
Version:
Braze SDK for web sites and other JS platforms.
16 lines (15 loc) • 539 B
JavaScript
import se from "../in-app-message-manager-factory.js";
import r from "../../managers/braze-instance.js";
import { setupInAppMessageUI as ss } 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;
ss();
const s = se.ea();
if (null == s.Xr()) {
const r = subscribeToInAppMessage((s) => showInAppMessage(s));
s.Hr(r);
}
return s.Xr();
}