mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-24 07:29:30 +01:00
web: set user status to premium during tests
This commit is contained in:
committed by
Abdullah Atta
parent
745c89ef86
commit
2334987359
@@ -18,7 +18,7 @@ module.exports = {
|
||||
},
|
||||
all: {
|
||||
UV_THREADPOOL_SIZE: IS_CI ? NUM_CPUS : 2,
|
||||
GENERATE_SOURCEMAP: process.env.NODE_ENV !== "production",
|
||||
GENERATE_SOURCEMAP: process.env.NODE_ENV === "development",
|
||||
INLINE_RUNTIME_CHUNK: false,
|
||||
DISABLE_ESLINT_PLUGIN: true,
|
||||
REACT_APP_GIT_HASH: gitHash,
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
useStore as useUserStore,
|
||||
store as userstore
|
||||
} from "../stores/user-store";
|
||||
import { isTesting } from "../utils/platform";
|
||||
|
||||
export function useIsUserPremium() {
|
||||
const user = useUserStore((store) => store.user);
|
||||
@@ -29,6 +30,7 @@ export function useIsUserPremium() {
|
||||
}
|
||||
|
||||
export function isUserPremium(user) {
|
||||
if (isTesting()) return true;
|
||||
if (!user) user = userstore.get().user;
|
||||
|
||||
const subStatus = user?.subscription?.type;
|
||||
|
||||
Reference in New Issue
Block a user