feat: check for files beta role (#986)
This commit is contained in:
@@ -8,13 +8,7 @@ import { FunctionComponent } from 'preact'
|
||||
import { useCallback, useEffect, useRef, useState } from 'preact/hooks'
|
||||
import { Icon } from '@/Components/Icon'
|
||||
import { useCloseOnBlur } from '@/Hooks/useCloseOnBlur'
|
||||
import {
|
||||
ChallengeReason,
|
||||
ContentType,
|
||||
FeatureIdentifier,
|
||||
FeatureStatus,
|
||||
SNFile,
|
||||
} from '@standardnotes/snjs'
|
||||
import { ChallengeReason, ContentType, SNFile } from '@standardnotes/snjs'
|
||||
import { confirmDialog } from '@/Services/AlertService'
|
||||
import { addToast, dismissToast, ToastType } from '@standardnotes/stylekit'
|
||||
import { StreamingFileReader } from '@standardnotes/filepicker'
|
||||
@@ -78,9 +72,7 @@ export const AttachedFilesButton: FunctionComponent<Props> = observer(
|
||||
}, [application, reloadAttachedFilesCount])
|
||||
|
||||
const toggleAttachedFilesMenu = useCallback(async () => {
|
||||
if (
|
||||
application.features.getFeatureStatus(FeatureIdentifier.Files) !== FeatureStatus.Entitled
|
||||
) {
|
||||
if (!appState.features.isEntitledToFiles) {
|
||||
premiumModal.activate('Files')
|
||||
return
|
||||
}
|
||||
@@ -107,7 +99,7 @@ export const AttachedFilesButton: FunctionComponent<Props> = observer(
|
||||
|
||||
setOpen(newOpenState)
|
||||
}
|
||||
}, [application.features, onClickPreprocessing, open, premiumModal])
|
||||
}, [appState.features.isEntitledToFiles, onClickPreprocessing, open, premiumModal])
|
||||
|
||||
const deleteFile = async (file: SNFile) => {
|
||||
const shouldDelete = await confirmDialog({
|
||||
|
||||
@@ -989,7 +989,7 @@ export class NoteView extends PureComponent<Props, State> {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{window.enabledUnfinishedFeatures && (
|
||||
{this.appState.features.isFilesEnabled && (
|
||||
<div className="mr-3">
|
||||
<AttachedFilesButton
|
||||
application={this.application}
|
||||
|
||||
Reference in New Issue
Block a user