mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
Some improvements - code cleanup
This commit is contained in:
parent
38eb31a140
commit
826f57c28d
2 changed files with 6 additions and 45 deletions
|
@ -1142,7 +1142,7 @@ const getChangesetInfo = async (pad: PadType, startNum: number, endNum:number, g
|
|||
getPadLines(pad, startNum - 1),
|
||||
// Get all needed composite Changesets.
|
||||
...compositesChangesetNeeded.map(async (item) => {
|
||||
const changeset = await composePadChangesets(pad, item.start, item.end);
|
||||
const changeset = await exports.composePadChangesets(pad, item.start, item.end);
|
||||
composedChangesets[`${item.start}/${item.end}`] = changeset;
|
||||
}),
|
||||
// Get all needed revision Dates.
|
||||
|
@ -1208,7 +1208,7 @@ const getPadLines = async (pad: PadType, revNum: number) => {
|
|||
* Tries to rebuild the composePadChangeset function of the original Etherpad
|
||||
* https://github.com/ether/pad/blob/master/etherpad/src/etherpad/control/pad/pad_changeset_control.js#L241
|
||||
*/
|
||||
const composePadChangesets = async (pad: PadType, startNum: number, endNum: number) => {
|
||||
exports.composePadChangesets = async (pad: PadType, startNum: number, endNum: number) => {
|
||||
// fetch all changesets we need
|
||||
const headNum = pad.getHeadRevisionNumber();
|
||||
endNum = Math.min(endNum, headNum + 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue