read parent (Incomplete)

This commit is contained in:
Sukhamjot Singh 2022-07-31 15:16:55 +05:30
parent 15f89f6a1c
commit a42c67c4e1
2 changed files with 14 additions and 2 deletions

View File

@ -401,7 +401,7 @@ function displaycomment() {
'td',
m('i.fas.fa-angle-right', {
class: 'fa-rotate-' + (commentStruct.showReplies ? '90' : '0'),
style: 'margin-top:12px',
style: 'cursor:pointer',
onclick: () => {
commentStruct.showReplies = !commentStruct.showReplies;
},
@ -525,7 +525,6 @@ const PostView = () => {
ownId.splice(i, 1);
}
}
console.log(ownId);
});
},
view: (v) =>

View File

@ -47,6 +47,19 @@ async function updatedisplayforums(keyid, details = {}) {
if (res3.body.retval) {
Data.Threads[keyid][thread.mMsgId] = { thread: res3.body.msgs[0], showReplies: false };
if (
Data.Threads[keyid][thread.mMsgId] &&
Data.Threads[keyid][thread.mMsgId].thread.mMeta.mMsgStatus === THREAD_UNREAD
) {
let parent = Data.Threads[keyid][thread.mMsgId].thread.mMeta.mParentId;
console.log("orig: " + Data.Threads[keyid][thread.mMsgId].thread.mMeta.mMsgName);
while(Data.Threads[keyid][parent])
{
console.log(Data.Threads[keyid][parent].thread.mMeta.mMsgName);
Data.Threads[keyid][parent].thread.mMeta.mMsgStatus = THREAD_UNREAD;
parent = Data.Threads[keyid][parent].thread.mMeta.mParentId;
}
}
}
if (Data.ParentThreads[keyid] === undefined) {
Data.ParentThreads[keyid] = {};