Switch to internally managed roles, adapt frontend

This commit is contained in:
2025-10-07 02:04:35 +02:00
parent dc0ec5c635
commit 90729736ca
11 changed files with 248 additions and 351 deletions

View File

@@ -1,4 +1,4 @@
import { type Me } from "common/the_api";
import { type User } from "common/the_api";
import { identity } from "effect";
import { useLayoutEffect, useState } from "react";
@@ -10,14 +10,14 @@ export const mapProp = <const K extends string, T>(prop: K, action: Update<T>) =
};
export interface Store {
readonly user: Me | null;
readonly user: User | null;
}
let store: Store = Object.freeze<Store>({
user: null,
});
export function setUser(action: Update<Me | null>) {
export function setUser(action: Update<User | null>) {
set(mapProp("user", action));
}