Skip to content

Commit

Permalink
Merge pull request #854 from basedosdados/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
AldemirLucas authored May 21, 2024
2 parents d4a75cd + 84c4ec6 commit e8057c8
Show file tree
Hide file tree
Showing 9 changed files with 423 additions and 268 deletions.
2 changes: 0 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@ services:
- .env
ports:
- ${NEXT_PORT}:3000
volumes:
- ./next:/app
3 changes: 2 additions & 1 deletion next/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ FROM node:18.17.0-alpine AS runner
WORKDIR /app

ENV NODE_ENV production
ENV NODE_OPTIONS '-r next-logger'
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1

Expand All @@ -58,4 +59,4 @@ EXPOSE 3000

ENV PORT 3000

CMD ["node", "server.js"]
CMD ["server.js"]
6 changes: 5 additions & 1 deletion next/components/atoms/ControlledInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,16 @@ export function DebouncedControlledInput({
inputElementStyle,
...props
}) {
const [skipFirstDebounced, setSkipFirstDebounced] = useState(true)
const [_value, _setValue] = useState(value);
const [_timeout, _setTimeout] = useState(null);

useEffect(() => {
clearTimeout(_timeout);
_setTimeout(setTimeout(() => onChange(_value), 1000));
_setTimeout(setTimeout(() => {
if(!skipFirstDebounced) onChange(_value)
setSkipFirstDebounced(false)
}, 1000));
}, [_value]);

useEffect(() => {
Expand Down
Loading

0 comments on commit e8057c8

Please sign in to comment.