Comments (4)
Like this
setInterval(async () => {
if (!get(profile)) return
const { user, jwt } = get(profile)!
if (!jwt || !user) return
const response = await getClient().getUnreadCount({
auth: jwt,
})
user.unreads =
response.mentions + response.private_messages + response.replies
if (amModOfAny(user)) {
const reports = await getClient().getReportCount({
auth: jwt,
})
user.reports =
reports.comment_reports +
reports.post_reports +
(reports.private_message_reports ?? 0)
}
profile.update((p) => ({
...p!,
user: user,
}))
}, 30 * 1000)
from photon.
Will fix today
from photon.
This is because of how stores work. in .svelte files, the compiler automatically converts the stores to be reactive, but in TS files, get
isn't reactive. so you have to use store.update()
from photon.
Ah, OK. I tried doing update()
on user
but got runtime errors... didn't think of updating the user
inside of the profile
.
from photon.
Related Issues (20)
- Profile media page is broken in SSR mode HOT 3
- Feature request: Auto-expand right sidebar items HOT 2
- Bug: Profile menu jumps when scrolling HOT 2
- Scrollbar does not show on Chromium based browser such as Brave and Chromium HOT 2
- Implement rate limit admin settings
- How to change the default frontend Lemmy ui to Photon HOT 2
- Bug: Lemmy link detection false positives HOT 4
- Link to News' MBFC site instead of general website.
- Show moderator who resolved report
- Changing between preview and edit modes resets input field size
- Unsorted/unfiltered content flashing on loading page HOT 4
- [Feature Request] Mark as Read Button on Post HOT 2
- [Enhancement] Refresh when going "Home" HOT 5
- Bug: Pinned posts shown as compact on feed
- Add Bulgarian translation HOT 3
- Overview of upvoted/downvoted comments HOT 1
- Feature request: Show instance banner
- [Enhancement] Show time when a post or comment was last edited
- Bug: Video in markdown overflows.
- v1.31.2 results in broken site on upgrade, only spinner visible HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from photon.