forked from akai/readest
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dfa0468d24 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@readest/readest-app",
|
||||
"version": "0.9.20",
|
||||
"version": "0.9.21",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "dotenv -e .env.tauri -- next dev",
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
{
|
||||
"releases": {
|
||||
"0.9.21": {
|
||||
"date": "2025-03-10",
|
||||
"notes": [
|
||||
"Fix column height in vertical layout on mobile",
|
||||
"Fix drag handle height not constant on mobile",
|
||||
"Add fullscreen option on desktop",
|
||||
"Add drag and drop to import books on desktop",
|
||||
"Various fixes and enhancements on updater, footerbar and note"
|
||||
]
|
||||
},
|
||||
"0.9.20": {
|
||||
"date": "2025-03-10",
|
||||
"notes": [
|
||||
|
||||
@@ -103,15 +103,15 @@ const FooterBar: React.FC<FooterBarProps> = ({
|
||||
</div>
|
||||
<Button
|
||||
icon={viewSettings?.rtl ? <RiArrowGoForwardLine /> : <RiArrowGoBackLine />}
|
||||
onClick={viewSettings?.rtl ? handleGoForward : handleGoBack}
|
||||
tooltip={viewSettings?.rtl ? _('Go Forward') : _('Go Back')}
|
||||
disabled={viewSettings?.rtl ? !view?.history.canGoForward : !view?.history.canGoBack}
|
||||
onClick={handleGoBack}
|
||||
tooltip={_('Go Back')}
|
||||
disabled={!view?.history.canGoBack}
|
||||
/>
|
||||
<Button
|
||||
icon={viewSettings?.rtl ? <RiArrowGoBackLine /> : <RiArrowGoForwardLine />}
|
||||
onClick={viewSettings?.rtl ? handleGoBack : handleGoForward}
|
||||
tooltip={viewSettings?.rtl ? _('Go Back') : _('Go Forward')}
|
||||
disabled={viewSettings?.rtl ? !view?.history.canGoBack : !view?.history.canGoForward}
|
||||
onClick={handleGoForward}
|
||||
tooltip={_('Go Forward')}
|
||||
disabled={!view?.history.canGoForward}
|
||||
/>
|
||||
<span className='mx-2 text-center text-sm'>
|
||||
{progressValid ? `${Math.round(progressFraction * 100)}%` : ''}
|
||||
|
||||
@@ -59,6 +59,8 @@ export const useClickEvent = (
|
||||
}
|
||||
}
|
||||
} else if (msg.data.type === 'iframe-wheel') {
|
||||
// FIXME: conlict with the touchpad scroll event on macOS
|
||||
if (viewSettings.scrolled && appService?.osPlatform === 'macos') return;
|
||||
const { deltaY } = msg.data;
|
||||
const fontSize = viewSettings?.defaultFontSize ?? 16;
|
||||
const lineHeight = viewSettings?.lineHeight ?? 1.6;
|
||||
|
||||
@@ -72,7 +72,7 @@ export const useNotesSync = (bookKey: string) => {
|
||||
...oldNotes.filter((oldNote) => !newNotes.some((newNote) => newNote.id === oldNote.id)),
|
||||
...newNotes.map(processNewNote),
|
||||
];
|
||||
setConfig(bookKey, { ...config, booknotes: mergedNotes });
|
||||
setConfig(bookKey, { booknotes: mergedNotes });
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [syncedNotes]);
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useBookDataStore } from '@/store/bookDataStore';
|
||||
import { useReaderStore } from '@/store/readerStore';
|
||||
import { useSettingsStore } from '@/store/settingsStore';
|
||||
import { useTranslation } from '@/hooks/useTranslation';
|
||||
import { deserializeConfig, serializeConfig } from '@/utils/serializer';
|
||||
import { serializeConfig } from '@/utils/serializer';
|
||||
import { CFI } from '@/libs/document';
|
||||
import { eventDispatcher } from '@/utils/event';
|
||||
import { DEFAULT_BOOK_SEARCH_CONFIG, SYNC_PROGRESS_INTERVAL_SEC } from '@/services/constants';
|
||||
@@ -106,14 +106,9 @@ export const useProgressSync = (bookKey: string) => {
|
||||
configSynced.current = true;
|
||||
const syncedConfig = syncedConfigs.filter((c) => c.bookHash === bookKey.split('-')[0])[0];
|
||||
if (syncedConfig) {
|
||||
const newConfig = deserializeConfig(
|
||||
JSON.stringify(syncedConfig),
|
||||
settings.globalViewSettings,
|
||||
DEFAULT_BOOK_SEARCH_CONFIG,
|
||||
);
|
||||
setConfig(bookKey, { ...config, ...newConfig });
|
||||
const syncedCFI = syncedConfig.location;
|
||||
const configCFI = config?.location;
|
||||
const syncedCFI = syncedConfig.location;
|
||||
setConfig(bookKey, syncedConfig);
|
||||
if (syncedCFI && configCFI) {
|
||||
if (CFI.compare(configCFI, syncedCFI) < 0) {
|
||||
if (view) {
|
||||
|
||||
@@ -17,7 +17,7 @@ interface BookData {
|
||||
interface BookDataState {
|
||||
booksData: { [id: string]: BookData };
|
||||
getConfig: (key: string | null) => BookConfig | null;
|
||||
setConfig: (key: string, config: BookConfig) => void;
|
||||
setConfig: (key: string, partialConfig: Partial<BookConfig>) => void;
|
||||
saveConfig: (
|
||||
envConfig: EnvConfigType,
|
||||
bookKey: string,
|
||||
@@ -39,9 +39,11 @@ export const useBookDataStore = create<BookDataState>((set, get) => ({
|
||||
const id = key.split('-')[0]!;
|
||||
return get().booksData[id]?.config || null;
|
||||
},
|
||||
setConfig: (key: string, config: BookConfig) => {
|
||||
setConfig: (key: string, partialConfig: Partial<BookConfig>) => {
|
||||
set((state: BookDataState) => {
|
||||
const id = key.split('-')[0]!;
|
||||
const config = (state.booksData[id]?.config || {}) as BookConfig;
|
||||
Object.assign(config, partialConfig);
|
||||
return {
|
||||
booksData: {
|
||||
...state.booksData,
|
||||
|
||||
Reference in New Issue
Block a user