feat: show login dialogue for features behind login (#4431)

This commit is contained in:
Akash K
2024-11-13 12:41:39 +05:30
committed by GitHub
parent 3de3209d5e
commit 1dc0cee536
6 changed files with 43 additions and 17 deletions

View File

@@ -106,6 +106,9 @@ import { useNestedSetting } from "~/composables/settings"
import { toggleNestedSetting } from "~/newstore/settings"
import { useAIExperiments } from "~/composables/ai-experiments"
import { prettifyJSONC } from "~/helpers/editor/linting/jsoncPretty"
import { useReadonlyStream } from "~/composables/stream"
import { platform } from "~/platform"
import { invokeAction } from "~/helpers/actions"
type PossibleContentTypes = Exclude<
ValidContentTypes,
@@ -220,7 +223,17 @@ const prettifyRequestBody = () => {
const isModifyBodyModalOpen = ref(false)
const currentUser = useReadonlyStream(
platform.auth.getCurrentUserStream(),
platform.auth.getCurrentUser()
)
const showModifyBodyModal = () => {
if (!currentUser.value) {
invokeAction("modals.login.toggle")
return
}
isModifyBodyModalOpen.value = true
}