Switch to internally managed roles, adapt frontend
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user