mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-15 01:16:38 +00:00
Chungus
This commit is contained in:
29
src/hooks/privateUseSubscriptionStatusContext.ts
Normal file
29
src/hooks/privateUseSubscriptionStatusContext.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
Reference in New Issue
Block a user