mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
ExportEtherpad: Invert conditions to improve readability
Also delete unnecessary comments.
This commit is contained in:
parent
b82ccb76df
commit
3004bc1583
1 changed files with 10 additions and 19 deletions
|
@ -31,25 +31,16 @@ exports.getPadRaw = async (padId, readOnlyId) => {
|
||||||
const data = {};
|
const data = {};
|
||||||
for (const keySuffix of keySuffixes) {
|
for (const keySuffix of keySuffixes) {
|
||||||
const entry = data[keyPrefixWrite + keySuffix] = await db.get(keyPrefixRead + keySuffix);
|
const entry = data[keyPrefixWrite + keySuffix] = await db.get(keyPrefixRead + keySuffix);
|
||||||
|
if (!entry.pool || !entry.pool.numToAttrib) continue;
|
||||||
// Get the Pad Authors
|
const authors = entry.pool.numToAttrib;
|
||||||
if (entry.pool && entry.pool.numToAttrib) {
|
for (const k of Object.keys(authors)) {
|
||||||
const authors = entry.pool.numToAttrib;
|
if (authors[k][0] !== 'author') continue;
|
||||||
|
const authorId = authors[k][1];
|
||||||
for (const k of Object.keys(authors)) {
|
const authorEntry = await db.get(`globalAuthor:${authorId}`);
|
||||||
if (authors[k][0] === 'author') {
|
if (!authorEntry) continue;
|
||||||
const authorId = authors[k][1];
|
data[`globalAuthor:${authorId}`] = authorEntry;
|
||||||
|
if (!authorEntry.padIDs) continue;
|
||||||
// Get the author info
|
authorEntry.padIDs = readOnlyId || padId;
|
||||||
const authorEntry = await db.get(`globalAuthor:${authorId}`);
|
|
||||||
if (authorEntry) {
|
|
||||||
data[`globalAuthor:${authorId}`] = authorEntry;
|
|
||||||
if (authorEntry.padIDs) {
|
|
||||||
authorEntry.padIDs = readOnlyId || padId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue