feat: allow plain ask a question for paid users only (#20390)
Co-authored-by: Keith Williams <[email protected]>
This commit is contained in:
1 parent
d80ed07093
commit
81de95bd28
1 file changed
+12
-8
@@ -87,6 +87,7 @@ const PlainChat = IS_PLAIN_CHAT_ENABLED
|
||||
|
||||
const shouldOpenPlain = pathname === "/event-types" && searchParams?.has("openPlain");
|
||||
const userEmail = session?.user?.email;
|
||||
const isPaidUser = session?.user.belongsToActiveTeam || !!session?.user.org;
|
||||
|
||||
const isAppDomain = useMemo(() => {
|
||||
const restrictedPathsSet = new Set(
|
||||
@@ -166,14 +167,6 @@ const PlainChat = IS_PLAIN_CHAT_ENABLED
|
||||
},
|
||||
],
|
||||
chatButtons: [
|
||||
{
|
||||
icon: "chat",
|
||||
text: "Ask a question",
|
||||
threadDetails: {
|
||||
labelTypeIds: ["lt_01JFJWNWAC464N8DZ6YE71YJRF"],
|
||||
tierIdentifier: { externalId: data.userTier },
|
||||
},
|
||||
},
|
||||
{
|
||||
icon: "bulb",
|
||||
text: "Send feedback",
|
||||
@@ -238,6 +231,17 @@ const PlainChat = IS_PLAIN_CHAT_ENABLED
|
||||
},
|
||||
};
|
||||
|
||||
if (isPaidUser) {
|
||||
plainChatConfig.chatButtons.push({
|
||||
icon: "chat",
|
||||
text: "Ask a question",
|
||||
threadDetails: {
|
||||
labelTypeIds: ["lt_01JFJWNWAC464N8DZ6YE71YJRF"],
|
||||
tierIdentifier: { externalId: data.userTier },
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") {
|
||||
window.__PLAIN_CONFIG__ = plainChatConfig;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user