Skip to content

Commit

Permalink
Merge pull request #79 from vordgi/nt-78
Browse files Browse the repository at this point in the history
nt-78 release 1.2.0
  • Loading branch information
vordgi authored May 6, 2024
2 parents c9ba60a + ee1cdc6 commit 1e83e2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nimpl/i18n",
"version": "1.1.2",
"version": "1.2.0",
"description": "i18n library for working with translations in server and client components",
"exports": {
"./ClientTranslation": {
Expand Down
6 changes: 3 additions & 3 deletions package/src/withI18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import createCacheServer from "./configuration/createCacheServer";
const PORT = "24";
let cacheSecret = process.env.I18N_CACHE_SECRET;

const withI18n = async (phase: string) => {
if (!cacheSecret && process.env.NODE_ENV === "development") {
const withI18n = async () => {
if (!cacheSecret) {
try {
const devResp = await fetch(`http://localhost:${PORT}/?type=dev`);
const data = await devResp.json();
Expand All @@ -16,7 +16,7 @@ const withI18n = async (phase: string) => {
}
}

if ((phase === "phase-development-server" || phase === "phase-production-server") && !cacheSecret) {
if (!cacheSecret) {
const { secret } = await createCacheServer(PORT);
cacheSecret = secret;
}
Expand Down

0 comments on commit 1e83e2e

Please sign in to comment.