Skip to content
This repository has been archived by the owner on Apr 23, 2022. It is now read-only.

(n ahead) after shuffling wrong #278

Open
njk345 opened this issue Nov 4, 2020 · 1 comment
Open

(n ahead) after shuffling wrong #278

njk345 opened this issue Nov 4, 2020 · 1 comment

Comments

@njk345
Copy link

njk345 commented Nov 4, 2020

I noticed that after a queue gets shuffled, the "(n ahead)" message in the tab does not get updated and shows the number from before shuffling. This was at least true for Safari on Mac.

@j-f1
Copy link
Contributor

j-f1 commented Nov 5, 2020

This is where the title is set:

const studentTicketIndex = queue
.tickets()
.fetch()
.filter(t => t.status === "open")
.findIndex(t => t.belongsToUser(Meteor.userId()));
let prefix;
if (studentTicketIndex === -1) {
prefix = queue.activeTickets().count();
} else if (studentTicketIndex === 0) {
prefix = "you’re next";
} else {
prefix = `${studentTicketIndex} ahead`;
}
document.title = `(${prefix}) ${queue.course().name} · ${
queue.name
} · SignMeUp`;

Somehow, it must not get called after the queue is shuffled. It seems to get called for most other updates, so I’m not sure why this could be.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants