JS-SDK: Added onNoAccess event

This commit is contained in:
Ilya Oleshko 2024-08-13 18:10:38 +03:00
parent 36226366d3
commit 625a7aa5a6
3 changed files with 6 additions and 0 deletions

View File

@ -38,6 +38,7 @@ import { IconButton } from "@docspace/shared/components/icon-button";
import RoomsFilter from "@docspace/shared/api/rooms/filter";
import { RoomSearchArea } from "@docspace/shared/enums";
import { frameCallEvent } from "@docspace/shared/utils/common";
import { getCategoryUrl } from "SRC_DIR/helpers/utils";
import { CategoryType } from "SRC_DIR/helpers/constants";
@ -60,6 +61,8 @@ const RoomNoAccessContainer = (props) => {
const navigate = useNavigate();
React.useEffect(() => {
frameCallEvent({ event: "onNoAccess" });
const timer = setTimeout(onGoToShared, 5000);
return () => clearTimeout(timer);
}, []);

View File

@ -75,6 +75,7 @@ export type TFrameEvents = {
onAuthSuccess: null | ((e: Event) => void);
onSignOut: null | ((e: Event) => void);
onDownload: null | ((e: Event) => void);
onNoAccess: null | ((e: Event) => void);
};
export type TFrameConfig = {
@ -96,6 +97,7 @@ export type TFrameConfig = {
showSelectorCancel: boolean;
showSelectorHeader: boolean;
showHeader: boolean;
showHeaderBanner: string;
showTitle: boolean;
showMenu: boolean;
showFilter: boolean;

View File

@ -97,6 +97,7 @@
onAuthSuccess: null,
onSignOut: null,
onDownload: null,
onNoAccess: null,
},
};