Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates warning message on double file open #375

Merged
merged 4 commits into from
Oct 17, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions packages/docprovider-extension/src/filebrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ namespace CommandIDs {
}
const DOCUMENT_TIMELINE_URL = 'api/collaboration/timeline';

const TWO_SESSIONS_WARNING =
'You have opened the file %1 with two separate views. ' +
'This is not supported. Please close one view; otherwise, ' +
'some of your edits may not be saved properly.';
JasonWeill marked this conversation as resolved.
Show resolved Hide resolved

/**
* The default collaborative drive provider.
*/
Expand Down Expand Up @@ -306,10 +311,7 @@ export const logger: JupyterFrontEndPlugin<void> = {
if (emission.level === 'WARNING') {
showDialog({
title: trans.__('Warning'),
body: trans.__(
`Two collaborative sessions are accessing the file ${emission.path} simultaneously.
\nOpening the same file using different views simultaneously is not supported. Please, close one view; otherwise, you might lose some of your progress.`
),
body: trans.__(TWO_SESSIONS_WARNING, emission.path),
buttons: [Dialog.okButton()]
});
}
Expand Down Expand Up @@ -355,11 +357,7 @@ export const logger: JupyterFrontEndPlugin<void> = {
if (emission.level === 'WARNING') {
showDialog({
title: trans.__('Warning'),
body: trans.__(
`Two collaborative sessions are accessing the file %1 simultaneously.
\nOpening a document with multiple views simultaneously is not supported. Please close one view; otherwise, you might lose some of your progress.`,
emission.path
),
body: trans.__(TWO_SESSIONS_WARNING, emission.path),
buttons: [Dialog.warnButton({ label: trans.__('Ok') })]
});
}
Expand Down
Loading