web: don't treat dev environment as a special case

This commit is contained in:
Abdullah Atta
2022-09-28 20:06:31 +05:00
committed by Abdullah Atta
parent f69afd2d9a
commit 2d277fbe2b
5 changed files with 4 additions and 17 deletions

View File

@@ -18,15 +18,14 @@ module.exports = {
},
all: {
UV_THREADPOOL_SIZE: IS_CI ? NUM_CPUS : 2,
GENERATE_SOURCEMAP: false,
GENERATE_SOURCEMAP: process.env.NODE_ENV !== "production",
INLINE_RUNTIME_CHUNK: false,
DISABLE_ESLINT_PLUGIN: true,
REACT_APP_GIT_HASH: gitHash,
REACT_APP_VERSION: APP_VERSION
},
dev: {
REACT_APP_LOCALHOST: ip.address(),
REACT_APP_CI: "true"
REACT_APP_LOCALHOST: ip.address()
},
web: {
REACT_APP_PLATFORM: "web"

View File

@@ -122,8 +122,6 @@ const onboarding = {
};
export function interruptedOnboarding() {
if (process.env.NODE_ENV === "development" || isTesting()) return;
for (let key in onboarding) {
const index = Config.get(key, undefined);
if (index >= 0 && index < onboarding[key].length - 1) return key;

View File

@@ -37,8 +37,7 @@ export default function useDatabase(persistence) {
(async () => {
await import("../app.css");
if (process.env.NODE_ENV !== "development")
await initializeDatabase(persistence);
await initializeDatabase(persistence);
setIsAppLoaded(true);
memory.isAppLoaded = true;
})();

View File

@@ -29,7 +29,6 @@ export function useIsUserPremium() {
}
export function isUserPremium(user) {
if (process.env.REACT_APP_CI) return true;
if (!user) user = userstore.get().user;
const subStatus = user?.subscription?.type;

View File

@@ -142,15 +142,7 @@ function isSessionExpired(path: Routes): RouteWithPath<AuthProps> | null {
return null;
}
if (process.env.NODE_ENV === "development") {
(async function dev() {
const { initializeDatabase } = await import("./common/db");
await initializeDatabase();
renderApp();
})();
} else {
renderApp();
}
renderApp();
async function renderApp() {
const {