mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-19 02:51:47 +08:00
feat(core): enable two step journal by default (#13283)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * The journal confirmation flow is now always enabled when creating or opening journals across all platforms. * **Refactor** * Removed the two-step journal confirmation feature flag and all related conditional logic. * Simplified journal navigation and creation flows for a more consistent user experience. * **Chores** * Cleaned up unused components and imports related to the removed feature flag. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import type { WeekDatePickerHandle } from '@affine/component';
|
||||
import { WeekDatePicker } from '@affine/component';
|
||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
||||
import {
|
||||
JOURNAL_DATE_FORMAT,
|
||||
JournalService,
|
||||
@@ -26,11 +25,6 @@ export const JournalWeekDatePicker = ({ page }: JournalWeekDatePickerProps) => {
|
||||
);
|
||||
const workbench = useService(WorkbenchService).workbench;
|
||||
|
||||
const featureFlagService = useService(FeatureFlagService);
|
||||
const isTwoStepJournalConfirmationEnabled = useLiveData(
|
||||
featureFlagService.flags.enable_two_step_journal_confirmation.$
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!journalDate) return;
|
||||
setDate(journalDate.format(JOURNAL_DATE_FORMAT));
|
||||
@@ -39,19 +33,14 @@ export const JournalWeekDatePicker = ({ page }: JournalWeekDatePickerProps) => {
|
||||
|
||||
const openJournal = useCallback(
|
||||
(date: string) => {
|
||||
if (isTwoStepJournalConfirmationEnabled) {
|
||||
const docs = journalService.journalsByDate$(date).value;
|
||||
if (docs.length > 0) {
|
||||
workbench.openDoc(docs[0].id, { at: 'active' });
|
||||
} else {
|
||||
workbench.open(`/journals?date=${date}`, { at: 'active' });
|
||||
}
|
||||
const docs = journalService.journalsByDate$(date).value;
|
||||
if (docs.length > 0) {
|
||||
workbench.openDoc(docs[0].id, { at: 'active' });
|
||||
} else {
|
||||
const doc = journalService.ensureJournalByDate(date);
|
||||
workbench.openDoc(doc.id, { at: 'active' });
|
||||
workbench.open(`/journals?date=${date}`, { at: 'active' });
|
||||
}
|
||||
},
|
||||
[isTwoStepJournalConfirmationEnabled, journalService, workbench]
|
||||
[journalService, workbench]
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user