unify single user and multi user behaviour
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
---
|
||||
import Base from '../../layouts/Base.astro';
|
||||
import StatsView from '../../components/StatsView.svelte';
|
||||
/**
|
||||
* Legacy route — redirects to /u/{handle}/stats/
|
||||
* In multi-user mode the user-widget script in the nav handles the correct link.
|
||||
*/
|
||||
import { readShardHandles } from '../../lib/manifest';
|
||||
const base = import.meta.env.BASE_URL;
|
||||
const shards = readShardHandles();
|
||||
const handle = shards[0]?.handle ?? null;
|
||||
---
|
||||
<Base title="Stats — BincioActivity">
|
||||
<h1 class="text-2xl font-bold text-white mb-6">Stats</h1>
|
||||
<StatsView client:load />
|
||||
</Base>
|
||||
{handle ? (
|
||||
<meta http-equiv="refresh" content={`0;url=${base}u/${handle}/stats/`} />
|
||||
<script define:vars={{ base, handle }}>
|
||||
window.location.replace(base + 'u/' + handle + '/stats/');
|
||||
</script>
|
||||
) : (
|
||||
<p>No data found. Run <code>bincio extract</code> first.</p>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user