Skip to content

Commit 50ace76

Browse files
committed
Fix after rebase
1 parent 335efec commit 50ace76

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

package-lock.json

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1529,6 +1529,8 @@
15291529
"@atlaskit/inline-dialog": "^18.0.4",
15301530
"@atlaskit/layering": "^3.0.0",
15311531
"@atlaskit/lozenge": "^13.0.8",
1532+
"@atlaskit/media-client": "^35.6.0",
1533+
"@atlaskit/media-core": "^37.0.0",
15321534
"@atlaskit/mention": "^24.2.18",
15331535
"@atlaskit/modal-dialog": "^14.3.4",
15341536
"@atlaskit/page": "^14.0.1",

src/webviews/components/issue/common/AtlaskitEditor/AtlaskitEditor.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { JSONTransformer } from '@atlaskit/editor-json-transformer';
99
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
1010
import { insertBlockPlugin } from '@atlaskit/editor-plugin-insert-block';
1111
import { listPlugin } from '@atlaskit/editor-plugin-list';
12+
// eslint-disable-next-line import/no-extraneous-dependencies
1213
import { mediaPlugin } from '@atlaskit/editor-plugin-media';
1314
import { mentionsPlugin } from '@atlaskit/editor-plugin-mentions';
1415
import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
@@ -57,6 +58,8 @@ interface AtlaskitEditorProps extends Omit<Partial<EditorNextProps>, 'onChange'
5758
onFocus: () => void;
5859
onBlur: () => void;
5960
isSaveOnBlur?: boolean;
61+
getMediaAuth?: () => Promise<{ token: string; clientId: string; baseUrl?: string }>;
62+
issueKey?: string;
6063
}
6164

6265
const AtlaskitEditor: React.FC<AtlaskitEditorProps> = (props: AtlaskitEditorProps) => {
@@ -131,6 +134,7 @@ const AtlaskitEditor: React.FC<AtlaskitEditorProps> = (props: AtlaskitEditorProp
131134
},
132135
});
133136
return { ...base, provider };
137+
// Only recreate if issueKey changes or if getMediaAuth changes from undefined to defined or vice versa
134138
}, [getMediaAuth, issueKey]);
135139

136140
const { preset, editorApi } = usePreset(() => {
@@ -162,7 +166,8 @@ const AtlaskitEditor: React.FC<AtlaskitEditorProps> = (props: AtlaskitEditorProp
162166
.add(mentionsPlugin)
163167
.add(tasksAndDecisionsPlugin)
164168
);
165-
}, [mediaOptions, mentionProvider]);
169+
// Only recreate preset when mediaOptions or appearance changes, NOT when mentionProvider changes
170+
}, [mediaOptions, appearance]);
166171
// Helper function to get current document content
167172
const getCurrentContent = React.useCallback(async (): Promise<any | null> => {
168173
try {

0 commit comments

Comments
 (0)