Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Build Error #3362

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ ARG NEXT_PUBLIC_JITSU_BROWSER_URL
ARG NEXT_PUBLIC_JITSU_BROWSER_WRITE_KEY
ARG NEXT_PUBLIC_GITHUB_APP_NAME=ever-github
ARG NEXT_PUBLIC_CHATWOOT_API_KEY
ARG NEXT_IGNORE_ESLINT_ERROR_ON_BUILD=true

FROM node:${NODE_VERSION}-slim as base
FROM node:${NODE_VERSION}-slim AS base

# Output the environment variable value
ARG NEXT_PUBLIC_GAUZY_API_SERVER_URL
RUN echo "NEXT_PUBLIC_GAUZY_API_SERVER_URL=${NEXT_PUBLIC_GAUZY_API_SERVER_URL}"

LABEL maintainer="ever@ever.co"
Expand All @@ -42,7 +44,7 @@ RUN mkdir /temp && cd /temp && \
RUN npm cache clean --force

# Throw-away build stage to reduce size of final image
FROM base as build
FROM base AS build

# We make env vars passed as build argument to be available in this build stage because we prebuild the NextJs app
ARG NEXT_PUBLIC_GAUZY_API_SERVER_URL
Expand Down Expand Up @@ -80,6 +82,7 @@ RUN cd apps/web && \
COPY . .

ENV NODE_ENV=production
ENV NEXT_IGNORE_ESLINT_ERROR_ON_BUILD=true

RUN echo $NEXT_PUBLIC_GAUZY_API_SERVER_URL

Expand All @@ -96,8 +99,6 @@ RUN yarn cache clean
# Final stage for app image
FROM base

ENV NODE_ENV=production

# Copy built application
COPY --from=build /app/apps/web/.next/standalone ./
COPY --from=build /app/apps/web/.next/static ./apps/web/.next/static
Expand Down
8 changes: 4 additions & 4 deletions apps/web/app/hooks/features/useOrganizationTeams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
teamsFetchingState,
timerStatusState
} from '@app/stores';
import { useCallback, useEffect, useState } from 'react';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { useAtom, useAtomValue, useSetAtom } from 'jotai';
import isEqual from 'lodash/isEqual';
import { useFirstLoad } from '../useFirstLoad';
Expand Down Expand Up @@ -305,8 +305,8 @@ export function useOrganizationTeams() {
const [isTeamManager, setIsTeamManager] = useState(false);
// const setMemberActiveTaskId = useSetAtom(memberActiveTaskIdState);

const members = activeTeam?.members || [];
const currentUser = activeTeam?.members?.find((member) => member.employee.userId === user?.id);
const members = useMemo(() => activeTeam?.members || [], [activeTeam?.members]);
const currentUser = members.find((member) => member.employee.userId === user?.id);

const memberActiveTaskId =
(timerStatus?.running && timerStatus?.lastLog?.taskId) || currentUser?.activeTaskId || null;
Expand Down Expand Up @@ -492,7 +492,7 @@ export function useOrganizationTeams() {
setActiveProjectIdCookie(activeTeam?.projects[0]?.id);
}
isManager();
}, [activeTeam]);
}, [activeTeam, isManager]);
NdekoCode marked this conversation as resolved.
Show resolved Hide resolved

return {
loadTeamsData,
Expand Down
Loading