24 lines
987 B
TypeScript
24 lines
987 B
TypeScript
// Metro module 12173 (f12174).
|
|
import AuthenticationStore from "../../../stores/AuthenticationStore";
|
|
import UserProfileStore from "../UserProfileStore";
|
|
import WidgetStore from "../WidgetStore";
|
|
import { useStateFromStores, useStateFromStoresArray } from "../../../_bundle/Module589";
|
|
export default function useUserProfileWidgets(a0) {
|
|
const stateFromStores = useStateFromStores([AuthenticationStore], () => {
|
|
const id = AuthenticationStore.getId();
|
|
return a0 != null && id === a0;
|
|
}, [a0]);
|
|
const stateFromStores2 = useStateFromStores([WidgetStore], () => WidgetStore.getPendingWidgets());
|
|
const stateFromStoresArray = useStateFromStoresArray([UserProfileStore], () => {
|
|
if (a0 == null) {
|
|
return [];
|
|
}
|
|
let r8 = UserProfileStore.getUserProfile(a0)?.widgets;
|
|
if (r8 == null) {
|
|
r8 = [];
|
|
}
|
|
return r8;
|
|
}, [a0]);
|
|
return stateFromStores ? stateFromStores2 !== null ? stateFromStores2 : stateFromStoresArray : stateFromStoresArray;
|
|
};
|