Update QuillSense conditional logic in UI components
- Adjusted conditions in `ScribeControllerBar`, `DraftCompanion`, and `DraftWordCount` to respect `QuillSense` enablement. - Ensured consistent handling of `quillsenseEnabled` property across features.
This commit is contained in:
@@ -130,7 +130,7 @@ export default function ScribeControllerBar() {
|
|||||||
<div className="min-w-[180px]">
|
<div className="min-w-[180px]">
|
||||||
<SelectBox onChangeCallBack={(e) => handleChapterVersionChanged(parseInt(e.target.value))}
|
<SelectBox onChangeCallBack={(e) => handleChapterVersionChanged(parseInt(e.target.value))}
|
||||||
data={chapterVersions.filter((version: SelectBoxProps): boolean => {
|
data={chapterVersions.filter((version: SelectBoxProps): boolean => {
|
||||||
return !(version.value === '1' && !hasAccess);
|
return !(version.value === '1' && (!hasAccess || book?.quillsenseEnabled === false));
|
||||||
}).map((version: SelectBoxProps) => {
|
}).map((version: SelectBoxProps) => {
|
||||||
return {
|
return {
|
||||||
value: version.value.toString(),
|
value: version.value.toString(),
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ export default function DraftCompanion() {
|
|||||||
return element ? element.label : value;
|
return element ? element.label : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showEnhancer && hasAccess) {
|
if (showEnhancer && hasAccess && book?.quillsenseEnabled !== false) {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-full min-h-0 overflow-hidden">
|
<div className="flex flex-col h-full min-h-0 overflow-hidden">
|
||||||
<div
|
<div
|
||||||
@@ -576,7 +576,7 @@ export default function DraftCompanion() {
|
|||||||
<span className="text-text-primary">{draftWordCount}</span>
|
<span className="text-text-primary">{draftWordCount}</span>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
hasAccess && chapter?.chapterContent.version === 3 && (
|
hasAccess && book?.quillsenseEnabled !== false && chapter?.chapterContent.version === 3 && (
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<SubmitButtonWLoading
|
<SubmitButtonWLoading
|
||||||
callBackAction={(): void => setShowEnhancer(true)}
|
callBackAction={(): void => setShowEnhancer(true)}
|
||||||
|
|||||||
Reference in New Issue
Block a user