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:
@@ -18,7 +18,7 @@ import Button from "@/components/ui/Button";
|
||||
import QSTextGeneratedPreview from "@/components/ui/QSTextGeneratedPreview";
|
||||
import {EditorContext, EditorContextProps} from "@/context/EditorContext";
|
||||
import {useTranslations} from '@/lib/i18n';
|
||||
import {getSubLevel, isOpenAIEnabled} from "@/lib/utils/quillsense";
|
||||
import {getSubLevel, isAnthropicEnabled} from "@/lib/utils/quillsense";
|
||||
import TextInput from "@/components/form/TextInput";
|
||||
import InputField from "@/components/form/InputField";
|
||||
import TextAreaInput from "@/components/form/TextAreaInput";
|
||||
@@ -93,9 +93,9 @@ export default function DraftCompanion() {
|
||||
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) && !isCurrentlyOffline() && !book?.localBook;
|
||||
const isAnthropicKey: boolean = isAnthropicEnabled(session);
|
||||
const isSubTierTwo: boolean = getSubLevel(session) >= 2;
|
||||
const hasAccess: boolean = (isAnthropicKey || isSubTierTwo) && !isCurrentlyOffline() && !book?.localBook;
|
||||
|
||||
useEffect((): void => {
|
||||
getDraftContent().then();
|
||||
|
||||
Reference in New Issue
Block a user