-
Notifications
You must be signed in to change notification settings - Fork 1
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
Boosts replies likes #46
base: master
Are you sure you want to change the base?
Conversation
Likes and replies crude display on buttons with cache/state issues to be fixed https://pad.lescommuns.org/xQpHj6XMQYWzyDFwRSfKrw
Likes and replies crude display on buttons with cache/state issues to be fixed https://pad.lescommuns.org/xQpHj6XMQYWzyDFwRSfKrw
staleTime: 0, // Consider data fresh for 5 minutes | ||
cacheTime: 0, // Cache unused data for 30 minutes. | ||
// staleTime: 5 * 60 * 1000, // Consider data fresh for 5 minutes | ||
// cacheTime: 30 * 60 * 1000, // Cache unused data for 30 minutes. |
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.
Indeed caching all data by default is a bad idea. It can still be done in a per-request basis.
https://marmelab.com/react-admin/DataProviders.html#react-query-options
@@ -10,16 +10,64 @@ import RelativeDate from '../../RelativeDate'; | |||
import useActor from '../../../hooks/useActor'; | |||
import { arrayOf } from '../../../utils'; | |||
import MoreButton from '../../buttons/MoreButton'; | |||
import { useCollection } from '@semapps/activitypub-components'; | |||
|
|||
const mentionRegex = /\<a href="([^"]*)" class=\"[^"]*?mention[^"]*?\">@\<span>(.*?)\<\/span>\<\/a\>/gm; | |||
|
|||
const Note = ({ object, activity, clickOnContent }) => { |
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.
To avoid problems, maybe we should pass objectUri
instead of object
id: noteId, | ||
}, | ||
{ | ||
enabled: !!noteId && !object?.replies, |
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.
object
is the object embedded within the activity, so we shouldn't rely on it (unless you want to load the note only if no replies are attached, but then you need to modify the code below ... in the current case, in some cases note will be loaded, and in other case it will not be loaded)
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.
In reality the object embedded within the activity will never have the replies
predicate.
No description provided.