Remove old commented code
This commit is contained in:
parent
dba4ec2955
commit
7171732bc0
|
@ -387,7 +387,6 @@ module.exports = ({ cooler, isPublic }) => {
|
|||
};
|
||||
const transform = (ssb, messages, myFeedId) =>
|
||||
Promise.all(
|
||||
// messages.flatMap(async msg => {
|
||||
messages.map(async msg => {
|
||||
debug("transforming %s", msg.key);
|
||||
|
||||
|
@ -395,10 +394,6 @@ module.exports = ({ cooler, isPublic }) => {
|
|||
return null;
|
||||
}
|
||||
|
||||
// if (Array.isArray(msg)) {
|
||||
// return await transform(ssb, msg, myFeedId)
|
||||
// }
|
||||
|
||||
const filterQuery = {
|
||||
$filter: {
|
||||
dest: msg.key
|
||||
|
@ -1204,14 +1199,8 @@ module.exports = ({ cooler, isPublic }) => {
|
|||
oneDeeper(key, 0)
|
||||
.then(nested => {
|
||||
const nestedReplies = [...nested];
|
||||
console.log("nested", JSON.stringify(nestedReplies, null, 2));
|
||||
const deepReplies = flattenDeep(nestedReplies);
|
||||
resolve(deepReplies);
|
||||
// note: returning this instead doesn't seem to help with rendering
|
||||
// forks since there are a lot more arrays than just for forks
|
||||
// (would maybe need some flattening in parts, but skipping all the
|
||||
// flattening doesn't work)
|
||||
// resolve(nestedReplies)
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
|
|
|
@ -257,19 +257,6 @@ const postInAside = msg => {
|
|||
};
|
||||
|
||||
const thread = messages => {
|
||||
// const renderPart = msgs => {
|
||||
// return msgs.map(msg => {
|
||||
// if (Array.isArray(msg)) {
|
||||
// if (msg.length === 0) return []
|
||||
// return details(renderPart(msg))
|
||||
// } else {
|
||||
// return post({ msg })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
// return renderPart(messages)
|
||||
|
||||
const addHints = messages => {
|
||||
const listWithHints = [];
|
||||
for (let i = 0; i <= messages.length; i++) {
|
||||
|
@ -341,56 +328,7 @@ const thread = messages => {
|
|||
return div({}, { innerHTML: htmlStrings.join("") });
|
||||
};
|
||||
|
||||
// console.log(addHints(messages))
|
||||
|
||||
return renderWithForks(addHints(messages));
|
||||
|
||||
// let i = 0
|
||||
// let lastDepth = 0
|
||||
|
||||
// const wrapDepth = (messages) => {
|
||||
// const renderedList = []
|
||||
|
||||
// let firstMsg = true
|
||||
|
||||
// while (i < messages.length) {
|
||||
// const msg = messages[i]
|
||||
// const currentDepth = lodash.get(msg, "value.meta.thread.depth", 0);
|
||||
// console.log('i', i)
|
||||
// console.log('lastDepth', lastDepth)
|
||||
// console.log('currentDepth', currentDepth)
|
||||
// console.log('msg', msg)
|
||||
|
||||
// if (firstMsg) {
|
||||
// // we're on the first post and we don't want the top level to be minimized
|
||||
// renderedList.push(post({ msg }))
|
||||
// i++
|
||||
// lastDepth = currentDepth
|
||||
// firstMsg = false
|
||||
// } else if (currentDepth > lastDepth) {
|
||||
// wrapDepth(messages)
|
||||
// } else if (currentDepth < lastDepth) {
|
||||
// return details(renderedList)
|
||||
// } else { // ===
|
||||
// renderedList.push(post({ msg }))
|
||||
// i++
|
||||
// lastDepth = currentDepth
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// return details(renderedList)
|
||||
// }
|
||||
|
||||
// return wrapDepth(messages)
|
||||
|
||||
// return messages.flatMap(msg => {
|
||||
// return [
|
||||
// //div({}, 'is this injected?'),
|
||||
// '<div>does this work??</div>',
|
||||
// post({ msg })
|
||||
// ];
|
||||
// });
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue