hotfix: fixed thread focus booting back to timeline while logged in,

width in chromium browsers
This commit is contained in:
ari melody 2024-07-02 20:54:41 +01:00
parent 4686a1307f
commit f5676f5b7a
Signed by: ari
GPG key ID: CF99829C92678188
4 changed files with 3 additions and 25 deletions

View file

@ -36,7 +36,6 @@
} }
body { body {
width: 100vw;
margin: 0; margin: 0;
padding: 0; padding: 0;

View file

@ -11,13 +11,11 @@ const save_name = "campfire";
export class Client { export class Client {
instance; instance;
app; app;
user;
#cache; #cache;
constructor() { constructor() {
this.instance = null; this.instance = null;
this.app = null; this.app = null;
this.user = null;
this.cache = { this.cache = {
users: {}, users: {},
emojis: {}, emojis: {},
@ -76,25 +74,6 @@ export class Client {
return await api.revokeToken(); return await api.revokeToken();
} }
async getClientUser() {
// already known
if (this.user) return this.user;
// cannot provide- not logged in
if (!this.app || !this.app.token) {
return false;
}
// logged in- attempt to retrieve using token
const data = await api.verifyCredentials();
if (!data) {
return false;
}
const user = await api.parseUser(data);
console.log(`Logged in as @${user.username}@${user.host}`);
return user;
}
async getNotifications(since_id, limit, types) { async getNotifications(since_id, limit, types) {
return await api.getNotifications(since_id, limit, types); return await api.getNotifications(since_id, limit, types);
} }

View file

@ -75,6 +75,7 @@
{/if} {/if}
</span> </span>
<span class="notif-activity">{@html activity_text.replace("%1", mention(data.accounts))}</span> <span class="notif-activity">{@html activity_text.replace("%1", mention(data.accounts))}</span>
<!-- TODO: timestamps -->
</header> </header>
{#if data.status} {#if data.status}
<div class="notif-content"> <div class="notif-content">

View file

@ -1,6 +1,7 @@
<script> <script>
import { client } from '$lib/client/client.js'; import { client } from '$lib/client/client.js';
import * as api from '$lib/client/api.js'; import * as api from '$lib/client/api.js';
import { logged_in } from '$lib/stores/user.js';
import { get } from 'svelte/store'; import { get } from 'svelte/store';
import { goto, afterNavigate } from '$app/navigation'; import { goto, afterNavigate } from '$app/navigation';
import { base } from '$app/paths' import { base } from '$app/paths'
@ -11,9 +12,7 @@
export let data; export let data;
let error = false; let error = false;
if (!get(client).instance || !get(client).user) { if (!get(logged_in)) goto("/");
goto("/");
}
let previous_page = base; let previous_page = base;