feat(overlay): add a check for ip addr and account id
All checks were successful
deploy / deploy (push) Successful in 57s
All checks were successful
deploy / deploy (push) Successful in 57s
This commit is contained in:
parent
226716b555
commit
cefaa734fd
@ -10,13 +10,14 @@ import { Label } from "@/components/ui/label";
|
|||||||
import { useOverlaySettingsStore } from "@/store/overlaySettingsStore";
|
import { useOverlaySettingsStore } from "@/store/overlaySettingsStore";
|
||||||
import useStore from "@/utils/useStore";
|
import useStore from "@/utils/useStore";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the overlay with the current settings
|
* Opens the overlay with the current settings
|
||||||
*
|
*
|
||||||
* @param settings the settings to pass to the overlay
|
* @param settings the settings to pass to the overlay
|
||||||
*/
|
*/
|
||||||
function goToOverlay(settings: any) {
|
function openOverlay(settings: any) {
|
||||||
window.open(`/overlay?data=${JSON.stringify(settings)}`, "_blank");
|
window.open(`/overlay?data=${JSON.stringify(settings)}`, "_blank");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,7 +121,15 @@ export default function Analytics() {
|
|||||||
<Button
|
<Button
|
||||||
className="mt-3"
|
className="mt-3"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
goToOverlay(settingsStore);
|
if (!settingsStore.ipAddress) {
|
||||||
|
toast.error("No IP Address provided");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!settingsStore.accountId) {
|
||||||
|
toast.error("No Account ID provided");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
openOverlay(settingsStore);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Open Overlay
|
Open Overlay
|
||||||
|
Loading…
Reference in New Issue
Block a user