fix table-list

This commit is contained in:
rizky 2024-08-15 08:38:57 -07:00
parent 32330d08e6
commit 273bcf451e
3 changed files with 11 additions and 3 deletions

View File

@ -247,7 +247,7 @@ export const TableList: FC<TableListProp> = ({
local.render(); local.render();
done(); done();
if (local.grid_ref) local.paging.scroll(local.grid_ref); if (local.grid_ref && !id_parent) local.paging.scroll(local.grid_ref);
}; };
if (result instanceof Promise) { if (result instanceof Promise) {

View File

@ -13,7 +13,6 @@ export const sessionClient = async <T extends SessionData>(arg: {
editorSampleData: T; editorSampleData: T;
auth: { auth: {
mode: "user-pass"; mode: "user-pass";
login: (arg: { username: string; password: string }) => Promise<false | T>;
}; };
on?: Partial<{ on?: Partial<{
active: (arg: { token: string; data: T }) => any; active: (arg: { token: string; data: T }) => any;

View File

@ -12,7 +12,16 @@ type ServerSession = {
}) => Promise<Response>; }) => Promise<Response>;
}; };
export const sessionServer = (arg: { encrypt?: boolean }): ServerSession => { export const sessionServer = <T>(arg: {
encrypt?: boolean;
on: {
login: (arg: {
mode: "user-pass";
username: string;
password: string;
}) => Promise<false | T>;
};
}): ServerSession => {
const s: ServerSession = { const s: ServerSession = {
async handle({ req, handle, mode, url }) { async handle({ req, handle, mode, url }) {
if (url.pathname.startsWith("/_session")) { if (url.pathname.startsWith("/_session")) {