unify single user and multi user behaviour
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
---
|
||||
import Base from '../layouts/Base.astro';
|
||||
import ActivityFeed from '../components/ActivityFeed.svelte';
|
||||
import { readShardHandles } from '../lib/manifest';
|
||||
|
||||
const base = import.meta.env.BASE_URL;
|
||||
const shards = readShardHandles();
|
||||
const isSingleUser = shards.length === 1;
|
||||
const singleHandle = isSingleUser ? shards[0].handle : null;
|
||||
---
|
||||
<Base title="BincioActivity — Feed">
|
||||
<h1 class="text-2xl font-bold text-white mb-6">Activities</h1>
|
||||
<ActivityFeed client:load />
|
||||
</Base>
|
||||
{isSingleUser ? (
|
||||
<!-- Single-user: redirect / → /u/{handle}/ -->
|
||||
<meta http-equiv="refresh" content={`0;url=${base}u/${singleHandle}/`} />
|
||||
<script define:vars={{ base, singleHandle }}>
|
||||
window.location.replace(base + 'u/' + singleHandle + '/');
|
||||
</script>
|
||||
) : (
|
||||
<Base title="BincioActivity — Feed">
|
||||
<h1 class="text-2xl font-bold text-white mb-6">Feed</h1>
|
||||
<ActivityFeed {base} client:only="svelte" />
|
||||
</Base>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user