diff --git a/server/version/version.go b/server/version/version.go index 0e63c1b2..41ded3c0 100644 --- a/server/version/version.go +++ b/server/version/version.go @@ -9,10 +9,10 @@ import ( // Version is the service current released version. // Semantic versioning: https://semver.org/ -var Version = "0.11.1" +var Version = "0.11.2" // DevVersion is the service current development version. -var DevVersion = "0.11.1" +var DevVersion = "0.11.2" func GetCurrentVersion(mode string) string { if mode == "dev" || mode == "demo" { diff --git a/web/src/components/AboutSiteDialog.tsx b/web/src/components/AboutSiteDialog.tsx index e68d1c1a..26044cc6 100644 --- a/web/src/components/AboutSiteDialog.tsx +++ b/web/src/components/AboutSiteDialog.tsx @@ -53,11 +53,7 @@ const AboutSiteDialog: React.FC = ({ destroy }: Props) => { /> Sticky notes - + Star history diff --git a/web/src/less/daily-memo.less b/web/src/less/daily-memo.less index 91e558e3..62d45c57 100644 --- a/web/src/less/daily-memo.less +++ b/web/src/less/daily-memo.less @@ -8,11 +8,11 @@ } > .split-line { - @apply h-full px-px bg-gray-50 dark:bg-zinc-600 absolute top-1 left-6 z-0 -ml-px; + @apply h-full px-px bg-gray-50 dark:bg-zinc-600 absolute top-1 left-6 -ml-px; } > .time-wrapper { - @apply mt-px mr-4 w-12 h-7 shrink-0 text-xs leading-6 text-center font-mono rounded-lg bg-gray-100 dark:bg-zinc-600 border-2 border-white dark:border-zinc-700 text-gray-600 dark:text-gray-300 z-10; + @apply mt-px mr-4 w-12 h-7 shrink-0 text-xs leading-6 text-center font-mono rounded-lg bg-gray-100 dark:bg-zinc-600 border-2 border-white z-1 dark:border-zinc-700 text-gray-600 dark:text-gray-300; } > .memo-container { diff --git a/web/src/pages/DailyReview.tsx b/web/src/pages/DailyReview.tsx index 225b745a..646e8b76 100644 --- a/web/src/pages/DailyReview.tsx +++ b/web/src/pages/DailyReview.tsx @@ -1,7 +1,9 @@ -import { useRef, useState } from "react"; +import { last } from "lodash-es"; +import { useEffect, useRef, useState } from "react"; +import toast from "react-hot-toast"; import { useTranslation } from "react-i18next"; import { useMemoStore, useUserStore } from "../store/module"; -import { DAILY_TIMESTAMP } from "../helpers/consts"; +import { DAILY_TIMESTAMP, DEFAULT_MEMO_LIMIT } from "../helpers/consts"; import * as utils from "../helpers/utils"; import MobileHeader from "../components/MobileHeader"; import useToggle from "../hooks/useToggle"; @@ -37,6 +39,24 @@ const DailyReview = () => { }) .sort((a, b) => utils.getTimeStampByDate(a.createdTs) - utils.getTimeStampByDate(b.createdTs)); + useEffect(() => { + const fetchMoreMemos = async () => { + try { + const fetchedMemos = await memoStore.fetchMemos(); + if (fetchedMemos.length === DEFAULT_MEMO_LIMIT) { + const lastMemo = last(fetchedMemos); + if (lastMemo && lastMemo.createdTs > currentDateStamp) { + await fetchMoreMemos(); + } + } + } catch (error: any) { + console.error(error); + toast.error(error.response.data.message); + } + }; + fetchMoreMemos(); + }, [currentDateStamp]); + const handleShareBtnClick = () => { if (!memosElRef.current) { return; @@ -99,8 +119,8 @@ const DailyReview = () => { handleDateStampChange={handleDataPickerChange} /> -
-
+
+
{currentDate.getFullYear()}
@@ -113,7 +133,7 @@ const DailyReview = () => {
{dailyMemos.length === 0 ? ( -
+

{t("daily-review.oops-nothing")}

) : (