hotfix: fixed thread focus booting back to timeline while logged in,
width in chromium browsers
This commit is contained in:
parent
4686a1307f
commit
f5676f5b7a
|
@ -36,7 +36,6 @@
|
|||
}
|
||||
|
||||
body {
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
|
|
|
@ -11,13 +11,11 @@ const save_name = "campfire";
|
|||
export class Client {
|
||||
instance;
|
||||
app;
|
||||
user;
|
||||
#cache;
|
||||
|
||||
constructor() {
|
||||
this.instance = null;
|
||||
this.app = null;
|
||||
this.user = null;
|
||||
this.cache = {
|
||||
users: {},
|
||||
emojis: {},
|
||||
|
@ -76,25 +74,6 @@ export class Client {
|
|||
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) {
|
||||
return await api.getNotifications(since_id, limit, types);
|
||||
}
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
{/if}
|
||||
</span>
|
||||
<span class="notif-activity">{@html activity_text.replace("%1", mention(data.accounts))}</span>
|
||||
<!-- TODO: timestamps -->
|
||||
</header>
|
||||
{#if data.status}
|
||||
<div class="notif-content">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<script>
|
||||
import { client } from '$lib/client/client.js';
|
||||
import * as api from '$lib/client/api.js';
|
||||
import { logged_in } from '$lib/stores/user.js';
|
||||
import { get } from 'svelte/store';
|
||||
import { goto, afterNavigate } from '$app/navigation';
|
||||
import { base } from '$app/paths'
|
||||
|
@ -11,9 +12,7 @@
|
|||
export let data;
|
||||
let error = false;
|
||||
|
||||
if (!get(client).instance || !get(client).user) {
|
||||
goto("/");
|
||||
}
|
||||
if (!get(logged_in)) goto("/");
|
||||
|
||||
let previous_page = base;
|
||||
|
||||
|
|
Loading…
Reference in a new issue