Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always create condensed wrapper #1485

Merged
merged 1 commit into from
Sep 3, 2017
Merged

Always create condensed wrapper #1485

merged 1 commit into from
Sep 3, 2017

Conversation

xPaw
Copy link
Member

@xPaw xPaw commented Sep 1, 2017

It would not create a wrapper for new channels and when the date changed.

@xPaw xPaw added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label Sep 1, 2017
@xPaw xPaw added this to the 2.5.0 milestone Sep 1, 2017
Copy link
Member

@AlMcKinlay AlMcKinlay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems sensible to me.

const msgTime = new Date(msg.time);

// It's the first message in a window,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, this would be an issue after removing the logic for not creating a condense if there is only 1 message, as it woudl never be created until we had a normal message.

// If date changed, we don't need to do condensed logic
container.append(renderedMessage);
return;
lastChild = $(templates.date_marker({msgDate: msgTime}));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this could be the issue. It's certainly not a great plan just now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that's a very confusing sentence.

I do this the code that was here could be the issue we were seeing with @Jay2k1 and what we were doing doesn't actually make any sense to do, because we are already checking if the last thing is a condensed message anyway.

But I have just realised why this won't work actually.

https://github.com/thelounge/lounge/blob/98e3bd0ca278fbcd8b120fbdaf6dfe4ec58633e7/client/views/date-marker.tpl

The date marker isn't a ".msg". So we'll miss the date marker, condense into the previous condensed, and the order will be wrong, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is possible.. I will look further into it later.

@xPaw
Copy link
Member Author

xPaw commented Sep 1, 2017

@YaManicKill I think I fixed the issue, and simplified the code a bit, so there's no longer need to check for parent element.

Copy link
Member

@astorije astorije left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trusting @YaManicKill (and you @xPaw obviously 😅) on that one.

One linting error to fix though:

37:8  error  'parent' is assigned a value but never used  no-unused-vars

Also @YaManicKill could you give this another try now that @xPaw has addressed the issue?

@astorije
Copy link
Member

astorije commented Sep 1, 2017

Nevermind, fixed that for ya.

@YaManicKill, feel free to merge if your test appears conclusive.

@xPaw xPaw merged commit 43c8f6f into master Sep 3, 2017
@xPaw xPaw deleted the xpaw/always-condense branch September 3, 2017 08:26
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
@AlMcKinlay AlMcKinlay removed their assignment Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants