release: version 0.9.55 (#1366)

* release: version 0.9.55

* layout: fix drag handler for multiple dialog instances
This commit is contained in:
Huang Xin
2025-06-07 13:55:36 +08:00
committed by GitHub
parent 5bdc29fe84
commit 95af3bd3d1
4 changed files with 20 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@readest/readest-app",
"version": "0.9.53",
"version": "0.9.55",
"private": true,
"scripts": {
"dev": "dotenv -e .env.tauri -- next dev",
+9
View File
@@ -1,5 +1,14 @@
{
"releases": {
"0.9.55": {
"date": "2025-06-07",
"notes": [
"Sync: Notes deleted on other devices now correctly sync across all platforms",
"Layout: Now text justification can be unset in the layout settings",
"Translation: Added notification when daily translation quota is exceeded",
"Performance: Reduced unnecessary animations on Android to improve efficiency"
]
},
"0.9.53": {
"date": "2025-06-05",
"notes": [
+9 -6
View File
@@ -1,5 +1,5 @@
import clsx from 'clsx';
import React, { ReactNode, useEffect, useState } from 'react';
import React, { ReactNode, useEffect, useRef, useState } from 'react';
import { MdArrowBackIosNew, MdArrowForwardIos } from 'react-icons/md';
import { useEnv } from '@/context/EnvContext';
import { useDrag } from '@/hooks/useDrag';
@@ -45,6 +45,7 @@ const Dialog: React.FC<DialogProps> = ({
const { acquireBackKeyInterception, releaseBackKeyInterception } = useDeviceControlStore();
const [isFullHeightInMobile, setIsFullHeightInMobile] = useState(!snapHeight);
const [isRtl] = useState(() => getDirFromUILanguage() === 'rtl');
const dialogRef = useRef<HTMLDialogElement>(null);
const iconSize22 = useResponsiveSize(22);
const isMobile = window.innerWidth < 640;
@@ -79,10 +80,10 @@ const Dialog: React.FC<DialogProps> = ({
}, [isOpen]);
const handleDragMove = (data: { clientY: number; deltaY: number }) => {
if (!isMobile) return;
if (!isMobile || !dialogRef.current) return;
const modal = document.querySelector('.modal-box') as HTMLElement;
const overlay = document.querySelector('.overlay') as HTMLElement;
const modal = dialogRef.current.querySelector('.modal-box') as HTMLElement;
const overlay = dialogRef.current.querySelector('.overlay') as HTMLElement;
const heightFraction = data.clientY / window.innerHeight;
const newTop = Math.max(0.0, Math.min(1, heightFraction));
@@ -98,8 +99,9 @@ const Dialog: React.FC<DialogProps> = ({
};
const handleDragEnd = (data: { velocity: number; clientY: number }) => {
const modal = document.querySelector('.modal-box') as HTMLElement;
const overlay = document.querySelector('.overlay') as HTMLElement;
if (!isMobile || !dialogRef.current) return;
const modal = dialogRef.current.querySelector('.modal-box') as HTMLElement;
const overlay = dialogRef.current.querySelector('.overlay') as HTMLElement;
if (!modal || !overlay) return;
const snapUpper = snapHeight ? 1 - snapHeight - SNAP_THRESHOLD : 0.5;
@@ -148,6 +150,7 @@ const Dialog: React.FC<DialogProps> = ({
return (
<dialog
ref={dialogRef}
id={id ?? 'dialog'}
open={isOpen}
className={clsx(
@@ -260,7 +260,7 @@ export const UpdaterContent = ({ version }: { version?: string }) => {
}
};
if (!isMounted || !update) {
if (!isMounted || !newVersion) {
return null;
}