Skip to content

Commit

Permalink
fix: 🐛 Corrige a troca repentina do conteúdo de noMobileDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
Wellington Braga committed Dec 5, 2024
1 parent f85e834 commit 282b34c
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 47 deletions.
15 changes: 14 additions & 1 deletion src/app/noMobileDevice/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
import { NoMobileDevicePage } from "@/screens";
import { getTextTheme } from "@/screens/NoMobileDevice/themeTitle";

export default NoMobileDevicePage;
const NoMobileDevice = () => {
const theme = getTextTheme();
const { text, title } = theme;

return (
<NoMobileDevicePage
text={text}
title={title}
/>
);
};

export default NoMobileDevice;
30 changes: 17 additions & 13 deletions src/database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {
} from "../server/entities";
import { options } from "./config/config";

// [`${path.resolve(__dirname, "../")}server/entities/*.ts`],

const sqliteDataSource = new DataSource({
type: "sqlite",
database: options.storage,
Expand All @@ -42,17 +40,7 @@ const mySqlDataSource = new DataSource({
username: options.username,
password: options.password,
database: options.database,
entities: [
Event,
Ticket,
User,
Session,
Address,
ColorScheme,
Enterprise,
IssueCategory,
Subsidiary,
],
entities: [Event, Ticket, User, Session],
// synchronize: process.env.NODE_ENV !== "production",
synchronize: false,
...(process.env.DB_CA && {
Expand Down Expand Up @@ -84,6 +72,14 @@ const startDBConnection = async () => {
category: "database",
level: "log",
message: "Data Source has been initialized!",
data: {
database: options.database,
dialect: options.dialect,
host: options.host,
port: options.port,
userName: options.username,
storage: options.storage,
},
});
console.log("Data Source has been initialized!");
}
Expand All @@ -93,6 +89,14 @@ const startDBConnection = async () => {
category: "database",
level: "error",
message: "Error during Data Source initialization",
data: {
database: options.database,
dialect: options.dialect,
host: options.host,
port: options.port,
userName: options.username,
storage: options.storage,
},
});
captureException(err, {
tags: {
Expand Down
61 changes: 29 additions & 32 deletions src/screens/NoMobileDevice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import Logo from "public/Icon.png";

import qrCode from "public/qr-code.png";
import { useMemo } from "react";
import {
NoMobileContainer,
NoMobileContent,
Expand All @@ -14,40 +13,38 @@ import {
QRCodeImage,
QRCodeText,
} from "./styles";
import { getTextTheme } from "./themeTitle";

const NoMobileDevicePage = () => {
const theme = useMemo(() => getTextTheme(), []);
export interface NoMobileDeviceProps {
title: string;
text: string;
}

const { text, title } = theme;

return (
<NoMobileContainer>
<NoMobileLogo
width={100}
height={100}
alt="Services logo"
src={Logo}
const NoMobileDevicePage = ({ text, title }: NoMobileDeviceProps) => (
<NoMobileContainer>
<NoMobileLogo
width={100}
height={100}
alt="Services logo"
src={Logo}
priority
/>
<NoMobileContent>
<NoMobileTitle>{title}</NoMobileTitle>
<NoMobileText>{text}</NoMobileText>
</NoMobileContent>
<NoMobileQRCodeSection>
<QRCodeText>
Escaneie o QR Code para acessar o Services pelo seu celular
</QRCodeText>
<QRCodeImage
src={qrCode}
alt="QR Code"
width={160}
height={160}
priority
/>
<NoMobileContent>
<NoMobileTitle>{title}</NoMobileTitle>
<NoMobileText>{text}</NoMobileText>
</NoMobileContent>
<NoMobileQRCodeSection>
<QRCodeText>
Escaneie o QR Code para acessar o Services pelo seu celular
</QRCodeText>
<QRCodeImage
src={qrCode}
alt="QR Code"
width={160}
height={160}
priority
/>
</NoMobileQRCodeSection>
</NoMobileContainer>
);
};
</NoMobileQRCodeSection>
</NoMobileContainer>
);

export { NoMobileDevicePage };
3 changes: 2 additions & 1 deletion src/server/controllers/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export class SessionController {

return NextResponse.json(
UserView.getUser({
error: { message: AuthErrorMessage.InvalidLoginError },
error,
status: 500,
}),
{
Expand Down Expand Up @@ -247,6 +247,7 @@ export class SessionController {

return NextResponse.redirect(new URL("/login", req.nextUrl.clone()));
} catch (error) {
console.log({ error });
const err = error as Error;

captureException(error, {
Expand Down

0 comments on commit 282b34c

Please sign in to comment.