diff --git a/packages/web/src/javascripts/Components/Tags/TagsSection.tsx b/packages/web/src/javascripts/Components/Tags/TagsSection.tsx index 01eab909f7b..c699c69843e 100644 --- a/packages/web/src/javascripts/Components/Tags/TagsSection.tsx +++ b/packages/web/src/javascripts/Components/Tags/TagsSection.tsx @@ -1,7 +1,6 @@ import TagsList from '@/Components/Tags/TagsList' -import { ApplicationEvent } from '@/__mocks__/@standardnotes/snjs' import { observer } from 'mobx-react-lite' -import { FunctionComponent, useCallback, useEffect, useState } from 'react' +import { FunctionComponent } from 'react' import TagsSectionAddButton from './TagsSectionAddButton' import TagsSectionTitle from './TagsSectionTitle' import { useApplication } from '../ApplicationProvider' @@ -9,47 +8,6 @@ import { useApplication } from '../ApplicationProvider' const TagsSection: FunctionComponent = () => { const application = useApplication() - const [hasMigration, setHasMigration] = useState(false) - - const checkIfMigrationNeeded = useCallback(() => { - setHasMigration(application.items.hasTagsNeedingFoldersMigration()) - }, [application]) - - useEffect(() => { - const removeObserver = application.addEventObserver(async (event) => { - const events = [ApplicationEvent.CompletedInitialSync, ApplicationEvent.SignedIn] - if (events.includes(event)) { - checkIfMigrationNeeded() - } - }) - - return () => { - removeObserver() - } - }, [application, checkIfMigrationNeeded]) - - const runMigration = useCallback(async () => { - if ( - await application.alerts.confirm( - 'Introducing native, built-in nested tags without requiring the legacy Folders extension.

' + - " To get started, we'll need to migrate any tags containing a dot character to the new system.

" + - ' This migration will convert any tags with dots appearing in their name into a natural' + - ' hierarchy that is compatible with the new nested tags feature.' + - ' Running this migration will remove any "." characters appearing in tag names.', - 'New: Folders to Nested Tags', - 'Run Migration', - ) - ) { - application.mutator - .migrateTagsToFolders() - .then(() => { - void application.sync.sync() - checkIfMigrationNeeded() - }) - .catch(console.error) - } - }, [application, checkIfMigrationNeeded]) - return ( <> {application.navigationController.starredTags.length > 0 && ( @@ -68,11 +26,7 @@ const TagsSection: FunctionComponent = () => {
- + {!application.navigationController.isSearching && ( )} diff --git a/packages/web/src/javascripts/Components/Tags/TagsSectionTitle.tsx b/packages/web/src/javascripts/Components/Tags/TagsSectionTitle.tsx index 1333110eb9b..f6f03f74c04 100644 --- a/packages/web/src/javascripts/Components/Tags/TagsSectionTitle.tsx +++ b/packages/web/src/javascripts/Components/Tags/TagsSectionTitle.tsx @@ -7,11 +7,9 @@ import StyledTooltip from '../StyledTooltip/StyledTooltip' type Props = { features: FeaturesController - hasMigration: boolean - onClickMigration: () => void } -const TagsSectionTitle: FunctionComponent = ({ features, hasMigration, onClickMigration }) => { +const TagsSectionTitle: FunctionComponent = ({ features }) => { const entitledToFolders = features.hasFolders const modal = usePremiumModal() @@ -24,11 +22,6 @@ const TagsSectionTitle: FunctionComponent = ({ features, hasMigration, on <>
Folders - {hasMigration && ( - - )}
)