1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-11-20 19:40:52 -05:00

more optimization/error handling

This commit is contained in:
2022-04-22 09:18:53 -04:00
parent 831139c132
commit 8a97b706be
12 changed files with 93 additions and 72 deletions

View File

@@ -2,7 +2,6 @@ import { NextSeo } from "next-seo";
import Content from "../../components/Content";
import NotesList, { NotesListProps } from "../../components/NotesList";
import { getAllNotes } from "../../lib/helpers/parse-notes";
import { formatDateTZ } from "../../lib/helpers/format-date";
import type { GetStaticProps } from "next";
const Notes = ({ notesByYear }: NotesListProps) => (
@@ -26,7 +25,7 @@ export const getStaticProps: GetStaticProps = async () => {
const notesByYear: NotesListProps["notesByYear"] = {};
getAllNotes().map((note) => {
const year = formatDateTZ(note.date, "yyyy");
const year = new Date(note.date).getUTCFullYear();
(notesByYear[year] || (notesByYear[year] = [])).push(note);
});

View File

@@ -1,6 +1,8 @@
import { useEffect, useState } from "react";
import { ErrorBoundary } from "react-error-boundary";
import dynamic from "next/dynamic";
import { NextSeo } from "next-seo";
import Terminal from "../components/Terminal";
import { styled } from "../lib/styles/stitches.config";
// obviously, an interactive VNC display will not work even a little bit server-side
@@ -56,7 +58,11 @@ const Y2K = () => {
/>
<Wallpaper style={{ backgroundImage: wallpaperUrl ? `url(${wallpaperUrl})` : "" }}>
<VNC server={SOCKET_PROXY} />
<ErrorBoundary
fallback={<Terminal>Oh dear, it looks like something's gone VERY wrong. Sorry about that!</Terminal>}
>
<VNC server={SOCKET_PROXY} />
</ErrorBoundary>
</Wallpaper>
</>
);