Skip to content

Commit 3d19893

Browse files
committed
🔥(frontend) remove saving modal
The saving toast are removed. Users were complaining about the toast that was shown when saving a document.
1 parent 00b223f commit 3d19893

File tree

3 files changed

+10
-21
lines changed

3 files changed

+10
-21
lines changed

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ and this project adheres to
99

1010
## [Unreleased]
1111

12-
# Added
12+
## Added
1313

1414
- ✨Add image attachments with access control
15-
- ✨(frontend) Upload image to a document
15+
- ✨(frontend) Upload image to a document #211
16+
17+
## Changed
18+
19+
- 🔥(frontend) hide markdown button if not text #213
20+
21+
## Removed
22+
23+
- 🔥(frontend) remove saving modal #213
1624

1725

1826
## [1.2.1] - 2024-08-23

src/frontend/apps/e2e/__tests__/app-impress/doc-editor.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ test.describe('Doc Editor', () => {
106106
nthRow: 2,
107107
});
108108

109-
await expect(
110-
page.getByText(`Your document "${doc}" has been saved.`),
111-
).toBeVisible();
112-
113109
await expect(page.locator('h2').getByText(secondDoc)).toBeVisible();
114110

115111
await goToGridDoc(page, {

src/frontend/apps/impress/src/features/docs/doc-editor/hook/useSaveDoc.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { VariantType, useToastProvider } from '@openfun/cunningham-react';
21
import { useRouter } from 'next/router';
32
import { useCallback, useEffect, useRef, useState } from 'react';
4-
import { useTranslation } from 'react-i18next';
53
import * as Y from 'yjs';
64

75
import { useUpdateDoc } from '@/features/docs/doc-management/';
@@ -11,22 +9,9 @@ import { useDocStore } from '../stores';
119
import { toBase64 } from '../utils';
1210

1311
const useSaveDoc = (docId: string, doc: Y.Doc, canSave: boolean) => {
14-
const { toast } = useToastProvider();
15-
const { t } = useTranslation();
1612
const { forceSave, setForceSave } = useDocStore();
1713

1814
const { mutate: updateDoc } = useUpdateDoc({
19-
onSuccess: (data) => {
20-
toast(
21-
t('Your document "{{docTitle}}" has been saved.', {
22-
docTitle: data.title,
23-
}),
24-
VariantType.SUCCESS,
25-
{
26-
duration: 1500,
27-
},
28-
);
29-
},
3015
listInvalideQueries: [KEY_LIST_DOC_VERSIONS],
3116
});
3217
const [initialDoc, setInitialDoc] = useState<string>(

0 commit comments

Comments
 (0)