mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Tell other members in integration session when you save
This commit is contained in:
parent
6bc999573e
commit
cf003140b7
@ -1482,6 +1482,9 @@ define([
|
||||
console.error(obj.error);
|
||||
return void UI.warn(Messages.error);
|
||||
}
|
||||
content.integrationSave = `${myUniqueOOId}-${+new Date()}`;
|
||||
APP.integrationSaved = content.integrationSave;
|
||||
APP.onLocal();
|
||||
UI.log(Messages.saved);
|
||||
});
|
||||
}
|
||||
@ -3273,6 +3276,9 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
|
||||
});
|
||||
} else {
|
||||
APP.integrationSave = integrationSave;
|
||||
APP.integrationSetSaved = () => {
|
||||
hasUnsavedChanges = false;
|
||||
};
|
||||
evIntegrationSave.reg(function () {
|
||||
hasUnsavedChanges = true;
|
||||
});
|
||||
@ -3438,6 +3444,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
|
||||
var wasMigrating = content.migration;
|
||||
|
||||
var myLocks = getUserLock(getId(), true);
|
||||
var integrationSave = content.integrationSave;
|
||||
|
||||
content = json.content;
|
||||
|
||||
@ -3448,6 +3455,15 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null
|
||||
checkCheckpoint();
|
||||
}
|
||||
|
||||
// Integration: mark the current content as saved
|
||||
// if manually saved by someone else
|
||||
if (content.integrationSave !== APP.integrationSaved) {
|
||||
APP.integrationSaved = content.integrationSave;
|
||||
if (APP.integrationSetSaved) {
|
||||
APP.integrationSetSaved();
|
||||
}
|
||||
}
|
||||
|
||||
var editor = getEditor();
|
||||
if (content.hashes) {
|
||||
var latest = getLastCp(true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user