Refactor subscription logic and replace quill-sense references with ritor equivalents
- Updated `getCurrentSubscription` and related functions to reflect terminology changes. - Adjusted subscription levels and access checks to streamline logic. - Removed unused cases in `getSubLevel` and optimized conditionals for clarity.
This commit is contained in:
@@ -19,7 +19,7 @@ import GhostWriterTags from "@/components/ghostwriter/GhostWriterTags";
|
||||
import {TiptapNode} from "@/lib/types/chapter";
|
||||
import {convertTiptapToHTML} from "@/lib/utils/tiptap";
|
||||
import {useTranslations} from '@/lib/i18n';
|
||||
import {getSubLevel, isOpenAIEnabled} from "@/lib/utils/quillsense";
|
||||
import {getSubLevel, isAnthropicEnabled} from "@/lib/utils/quillsense";
|
||||
import {AIUsageContext, AIUsageContextProps} from "@/context/AIUsageContext";
|
||||
import {LangContext, LangContextProps} from "@/context/LangContext";
|
||||
import {configs} from "@/lib/configs";
|
||||
@@ -52,9 +52,9 @@ export default function GhostWriter() {
|
||||
const [useExplicit, setUseExplicit] = useState<boolean>(false);
|
||||
const [useSmart, setUseSmart] = useState<boolean>(false);
|
||||
|
||||
const isGPTEnabled: boolean = isOpenAIEnabled(session);
|
||||
const isSubTierTree: boolean = getSubLevel(session) === 3;
|
||||
const hasAccess: boolean = isGPTEnabled || isSubTierTree;
|
||||
const isAnthropicKey: boolean = isAnthropicEnabled(session);
|
||||
const isSubTierTwo: boolean = getSubLevel(session) >= 2;
|
||||
const hasAccess: boolean = isAnthropicKey || isSubTierTwo;
|
||||
|
||||
async function handleStopGeneration(): Promise<void> {
|
||||
if (abortController) {
|
||||
|
||||
Reference in New Issue
Block a user