time GSSP

This commit is contained in:
m5r 2021-07-21 11:29:29 +08:00
parent 6a12d0cd93
commit 067d0d97c4
3 changed files with 9 additions and 15 deletions

View File

@ -114,10 +114,9 @@ export function withPageAuthRequired<Props extends EmptyProps = EmptyProps>(
};
}
const getServerSidePropsResult = await getServerSideProps(
context,
user,
);
const start = Date.now();
const getServerSidePropsResult = await getServerSideProps(context, user);
console.log("getServerSideProps took", Date.now() - start);
if (!hasProps(getServerSidePropsResult)) {
return getServerSidePropsResult;
}

View File

@ -65,7 +65,7 @@ const Keypad: NextPage<Props> = () => {
const ZeroDigit: FunctionComponent = () => {
return (
<div className="text-3xl cursor-pointer">
<div className="text-3xl cursor-pointer select-none">
0 <DigitLetters>+</DigitLetters>
</div>
);
@ -117,12 +117,6 @@ const pressBackspaceAtom = atom(
},
);
export const getServerSideProps = withPageOnboardingRequired(
async (context, user) => {
return {
props: { userId: user.id, ddd: 23 as const },
};
},
);
export const getServerSideProps = withPageOnboardingRequired();
export default Keypad;

View File

@ -46,12 +46,13 @@ const Messages: NextPage<Props> = ({ conversations }) => {
};
type Recipient = string;
export type Conversation = Record<Recipient, Sms[]>;
export const getServerSideProps = withPageOnboardingRequired(
async (context, user) => {
const customer = await findCustomer(user.id);
const messages = await findCustomerMessages(user.id);
const [customer, messages] = await Promise.all([
findCustomer(user.id),
findCustomerMessages(user.id),
]);
let conversations: Record<Recipient, Sms> = {};
for (const message of messages) {