Multi-team & Slack App support#130
Open
JackCuthbert wants to merge 2 commits intomasterfrom
Open
Conversation
JackCuthbert
commented
Jan 4, 2021
| } | ||
|
|
||
| if (!config.updateWeekends && isWeekend(currentTime)) { | ||
| if (isWeekend(currentTime) && config.app.update_weekends) { |
Owner
Author
There was a problem hiding this comment.
Bad logic, should be:
if (isWeekend(currentTime) && !config.app.update_weekends) { }
JackCuthbert
commented
Jan 4, 2021
| await writeTrackJSON(track) | ||
| // Compute new status and duration | ||
| // --- | ||
| const trackDuration = track?.duration ?? 60 * (10 * 1000) // 10 minutes |
Owner
Author
There was a problem hiding this comment.
Change to:
const trackDuration = track?.duration ?? 600000 // 10 minutes
JackCuthbert
commented
Jan 4, 2021
Comment on lines
+100
to
+107
| for (const client of clients) { | ||
| const [presence, profile] = await Promise.all([ | ||
| client.getPresence(), | ||
| client.getProfile() | ||
| ]) | ||
|
|
||
| if (presence !== 'active') return | ||
| if (!profile.status_text.includes(config.app.separator)) return |
Owner
Author
There was a problem hiding this comment.
Not necessary to batch these requests, we can avoid the profile request if the presence is away.
JackCuthbert
commented
Jan 4, 2021
| .then(main) | ||
| .then(loop) | ||
| .catch(handleError) | ||
| .catch(console.error) |
Owner
Author
There was a problem hiding this comment.
process.exit(1) and schedule.stop() here?
e475759 to
4da0956
Compare
41e9795 to
b2aabbc
Compare
b2aabbc to
d19b9a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrites the core application to better support updating statuses across multiple teams and be installed as a Slack App.
Todo