-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fixed count, error state and created empty state component for scheduled post and draft #8626
base: scheduled-post-options
Are you sure you want to change the base?
Conversation
const preferences = queryDisplayNamePreferences(database). | ||
observeWithColumns(['value']); | ||
const isMilitaryTime = preferences.pipe(map((prefs) => getDisplayNamePreferenceAsBool(prefs, 'use_military_time'))); | ||
|
||
// TODO: fix the count for DM's and GM's and Thread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a Jira ticket to track this is planing to do it later?
const preferences = queryDisplayNamePreferences(database). | ||
observeWithColumns(['value']); | ||
const isMilitaryTime = preferences.pipe(map((prefs) => getDisplayNamePreferenceAsBool(prefs, 'use_military_time'))); | ||
|
||
// TODO: fix the count for DM's and GM's and Thread | ||
const scheduledPostCount = currentTeamId.pipe(switchMap((teamId) => observeScheduledPostCountForChannel(database, teamId, channelId))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
We need to include thread ID as well (root post's ID) as when in a thread, we need to show only that thread's count. Similarly when in channels, we need to exclude thread scheduled posts from the count.
-
You also need to fetch the scheduled post if count is
1
, and replace the hardcoded value in the component where there's a todo//TODO: remove this hardcoded value with actual value
with the scheduled post's scheduled at time. We need to display that time if there is only a single scheduled post in channel/thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only when crt is enabled, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, added crt checks as well.
2bd8672
to
5517875
Compare
92506d1
to
1bdb012
Compare
scheduledPostCount = observeScheduledPostCountForDMsAndGMs(database, channelId, isCRTEnabled); | ||
} else if (channelType === 'O' && channelId) { | ||
scheduledPostCount = currentTeamId.pipe(switchMap((teamId) => observeScheduledPostCountForChannel(database, teamId, channelId, isCRTEnabled))); | ||
} else if (rootId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If its a thread in open channel, the code will go the the above else if, not this else, right? That looks wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reverted the code, Now we will be checking firstly if rootId is present or not, if present that means we have to extract the count of the thread. If not then extract the count of the channel, DMs and GMs.
…led post and draft
1bdb012
to
39e11d0
Compare
Summary
Ticket Link
Checklist
E2E iOS tests for PR
.Device Information
This PR was tested on:
Screenshots
Release Note