Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: upgrade version to `0.11.2` (#1336)

boojack50f36e3ed5aa
diff --git a/server/version/version.go b/server/version/version.go
index 0e63c1b2f..41ded3c0e 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 e68d1c1a6..26044cc6b 100644
--- a/web/src/components/AboutSiteDialog.tsx
+++ b/web/src/components/AboutSiteDialog.tsx
@@ -53,11 +53,7 @@ const AboutSiteDialog: React.FC<Props> = ({ destroy }: Props) => {
/>
<span>Sticky notes</span>
</a>
- <a
- href="https://github.com/boojack/sticky-notes"
- target="_blank"
- className="flex items-center underline text-blue-600 hover:opacity-80"
- >
+ <a href="https://star-history.com" target="_blank" className="flex items-center underline text-blue-600 hover:opacity-80">
<img className="w-4 h-auto mr-1" src="https://star-history.com/icon.png" alt="" />
<span>Star history</span>
</a>
diff --git a/web/src/less/daily-memo.less b/web/src/less/daily-memo.less
index 91e558e3b..62d45c57a 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 225b745a5..646e8b766 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}
/>
</div>
- <div className="w-full h-auto flex flex-col justify-start items-start p-12 pt-26" ref={memosElRef}>
- <div className="flex flex-col justify-center items-center mx-auto pb-6 select-none">
+ <div className="w-full h-auto flex flex-col justify-start items-start px-2 sm:px-12 pt-14 pb-8" ref={memosElRef}>
+ <div className="flex flex-col justify-center items-center mx-auto pb-10 select-none">
<div className="mx-auto font-bold text-gray-600 dark:text-gray-300 text-center leading-6 mb-2">{currentDate.getFullYear()}</div>
<div className="flex flex-col justify-center items-center m-auto w-24 h-24 shadow rounded-3xl dark:bg-zinc-800">
<div className="text-center w-full leading-6 text-sm text-white bg-blue-700 rounded-t-3xl">
@@ -113,7 +133,7 @@ const DailyReview = () => {
</div>
</div>
{dailyMemos.length === 0 ? (
- <div className="mx-auto py-6 pb-12 px-0">
+ <div className="mx-auto pt-4 pb-5 px-0">
<p className="italic text-gray-400">{t("daily-review.oops-nothing")}</p>
</div>
) : (