@cripty2001/utils 0.0.228 → 0.0.230
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Appserver/client.js
CHANGED
|
@@ -51,7 +51,7 @@ class Client {
|
|
|
51
51
|
constructor(url, rpcMount) {
|
|
52
52
|
this.url = url;
|
|
53
53
|
this.rpcMount = rpcMount;
|
|
54
|
-
const [token, setToken] = whispr_1.Whispr.create(
|
|
54
|
+
const [token, setToken] = whispr_1.Whispr.create(''); // This will make sure the loggedin only flips to false when there is really an auth rejected. Server will ignore invalid tokens on public apis anyway
|
|
55
55
|
this.token = token;
|
|
56
56
|
this.setToken = setToken;
|
|
57
57
|
this.loggedIn = token.transform((t) => t !== null);
|
|
@@ -2,9 +2,9 @@ import type React from "react";
|
|
|
2
2
|
import type { Dispatcher } from "../Dispatcher";
|
|
3
3
|
export type LoaderProps<T> = {
|
|
4
4
|
data: Dispatcher<unknown, T>;
|
|
5
|
-
children:
|
|
5
|
+
children: (props: {
|
|
6
6
|
data: T;
|
|
7
|
-
}
|
|
7
|
+
}) => React.ReactNode;
|
|
8
8
|
loader?: React.ReactNode;
|
|
9
9
|
};
|
|
10
10
|
export default function Loader<T>(props: LoaderProps<T>): import("react/jsx-runtime").JSX.Element;
|
package/dist/react-ui/loader.js
CHANGED
|
@@ -22,7 +22,6 @@ function Loader(props) {
|
|
|
22
22
|
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Content, { data: data, children: props.children, loader: props.loader }) }));
|
|
23
23
|
}
|
|
24
24
|
function Content({ data, children, loader }) {
|
|
25
|
-
const ChildComponent = children;
|
|
26
25
|
if (data.loading)
|
|
27
26
|
return loader ?? ((0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100vh' }, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
28
27
|
animation: 'spin 1s linear infinite',
|
|
@@ -34,5 +33,5 @@ function Content({ data, children, loader }) {
|
|
|
34
33
|
} }) }));
|
|
35
34
|
if (!data.ok)
|
|
36
35
|
return (0, jsx_runtime_1.jsx)("div", { style: { color: '#ef4444' }, children: data.error.message });
|
|
37
|
-
return (
|
|
36
|
+
return children({ data: data.data });
|
|
38
37
|
}
|
package/package.json
CHANGED