another huge commit but we have notifs now yay

This commit is contained in:
ari melody 2024-07-02 19:38:20 +01:00
parent 015a3e65e1
commit 998e8f2517
Signed by: ari
GPG key ID: CF99829C92678188
17 changed files with 442 additions and 52 deletions

View file

@ -219,6 +219,7 @@ export async function parsePost(data, ancestor_count) {
let post = new Post();
post.text = data.content;
post.html = data.content;
post.reply = null;
if ((data.in_reply_to_id || data.reply) &&
@ -278,7 +279,7 @@ export async function parseUser(data) {
user = new User();
user.id = data.id;
user.nickname = data.display_name;
user.nickname = data.display_name.trim();
user.username = data.username;
user.avatar_url = data.avatar;
user.url = data.url;

View file

@ -1,6 +1,8 @@
import { Instance, server_types } from './instance.js';
import * as api from './api.js';
import { get, writable } from 'svelte/store';
import { last_read_notif_id } from '$lib/notifications.js';
import { user } from '$lib/stores/user.js';
export const client = writable(false);
@ -177,6 +179,7 @@ export class Client {
host: this.instance.host,
version: this.instance.version,
},
last_read_notif_id: get(last_read_notif_id),
app: this.app,
}));
}
@ -191,6 +194,7 @@ export class Client {
return false;
}
this.instance = new Instance(saved.instance.host, saved.instance.version);
last_read_notif_id.set(saved.last_read_notif_id || 0);
this.app = saved.app;
client.set(this);
return true;