mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-12 07:56:40 +00:00
Chungus 2.0
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* This file is part of a proprietary work.
|
||||
*
|
||||
* Copyright (c) 2025 Fossorial, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This file is licensed under the Fossorial Commercial License.
|
||||
* You may not use this file except in compliance with the License.
|
||||
* Unauthorized use, copying, modification, or distribution is strictly prohibited.
|
||||
*
|
||||
* This file is not licensed under the AGPLv3.
|
||||
*/
|
||||
|
||||
"use client";
|
||||
|
||||
import RemoteExitNodeContext from "@app/contexts/privateRemoteExitNodeContext";
|
||||
import { build } from "@server/build";
|
||||
import { useContext } from "react";
|
||||
|
||||
export function useRemoteExitNodeContext() {
|
||||
if (build == "oss") {
|
||||
return null;
|
||||
}
|
||||
const context = useContext(RemoteExitNodeContext);
|
||||
if (context === undefined) {
|
||||
throw new Error("useRemoteExitNodeContext must be used within a RemoteExitNodeProvider");
|
||||
}
|
||||
return context;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* This file is part of a proprietary work.
|
||||
*
|
||||
* Copyright (c) 2025 Fossorial, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This file is licensed under the Fossorial Commercial License.
|
||||
* You may not use this file except in compliance with the License.
|
||||
* Unauthorized use, copying, modification, or distribution is strictly prohibited.
|
||||
*
|
||||
* This file is not licensed under the AGPLv3.
|
||||
*/
|
||||
|
||||
import PrivateSubscriptionStatusContext from "@app/contexts/privateSubscriptionStatusContext";
|
||||
import { build } from "@server/build";
|
||||
import { useContext } from "react";
|
||||
|
||||
export function usePrivateSubscriptionStatusContext() {
|
||||
if (build == "oss") {
|
||||
return null;
|
||||
}
|
||||
const context = useContext(PrivateSubscriptionStatusContext);
|
||||
if (context === undefined) {
|
||||
throw new Error(
|
||||
"usePrivateSubscriptionStatusContext must be used within an PrivateSubscriptionStatusProvider"
|
||||
);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
@@ -1,21 +1,8 @@
|
||||
/*
|
||||
* This file is part of a proprietary work.
|
||||
*
|
||||
* Copyright (c) 2025 Fossorial, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This file is licensed under the Fossorial Commercial License.
|
||||
* You may not use this file except in compliance with the License.
|
||||
* Unauthorized use, copying, modification, or distribution is strictly prohibited.
|
||||
*
|
||||
* This file is not licensed under the AGPLv3.
|
||||
*/
|
||||
|
||||
"use client";
|
||||
|
||||
import { useState, useCallback, useEffect } from "react";
|
||||
import { AxiosResponse } from "axios";
|
||||
import { GetCertificateResponse } from "@server/routers/private/certificates";
|
||||
import { GetCertificateResponse } from "#private/routers/certificates";
|
||||
import { createApiClient } from "@app/lib/api";
|
||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||
|
||||
16
src/hooks/useRemoteExitNodeContext.ts
Normal file
16
src/hooks/useRemoteExitNodeContext.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import RemoteExitNodeContext from "@app/contexts/remoteExitNodeContext";
|
||||
import { build } from "@server/build";
|
||||
import { useContext } from "react";
|
||||
|
||||
export function useRemoteExitNodeContext() {
|
||||
if (build == "oss") {
|
||||
return null;
|
||||
}
|
||||
const context = useContext(RemoteExitNodeContext);
|
||||
if (context === undefined) {
|
||||
throw new Error("useRemoteExitNodeContext must be used within a RemoteExitNodeProvider");
|
||||
}
|
||||
return context;
|
||||
}
|
||||
16
src/hooks/useSubscriptionStatusContext.ts
Normal file
16
src/hooks/useSubscriptionStatusContext.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import SubscriptionStatusContext from "@app/contexts/subscriptionStatusContext";
|
||||
import { build } from "@server/build";
|
||||
import { useContext } from "react";
|
||||
|
||||
export function useSubscriptionStatusContext() {
|
||||
if (build == "oss") {
|
||||
return null;
|
||||
}
|
||||
const context = useContext(SubscriptionStatusContext);
|
||||
if (context === undefined) {
|
||||
throw new Error(
|
||||
"useSubscriptionStatusContext must be used within an SubscriptionStatusProvider"
|
||||
);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
Reference in New Issue
Block a user