forked from akai/readest
hotfix: fix window cannot be dragged when light traffic widget is shown on macOS (#304)
* fix: fix window cannot be dragged when light traffic widget is shown on macOS * fix: detecting tauri focus event for deeplink redirect in oauth * release: version 0.9.9
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@readest/readest-app",
|
||||
"version": "0.9.8",
|
||||
"version": "0.9.9",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "dotenv -e .env.tauri -- next dev",
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
{
|
||||
"releases": {
|
||||
"0.9.9": {
|
||||
"date": "2025-02-06",
|
||||
"notes": [
|
||||
"Load system fonts list at runtime on desktop",
|
||||
"Incrementally load new books in synchronization",
|
||||
"Change voice language dynamically by detecting text language",
|
||||
"Various fixes and enhancements on sync, fonts and highlighting"
|
||||
]
|
||||
},
|
||||
"0.9.8": {
|
||||
"date": "2025-02-01",
|
||||
"notes": [
|
||||
|
||||
@@ -16,9 +16,10 @@ import { useTheme } from '@/hooks/useTheme';
|
||||
import { useEnv } from '@/context/EnvContext';
|
||||
import { useSettingsStore } from '@/store/settingsStore';
|
||||
import { isTauriAppPlatform } from '@/services/environment';
|
||||
import { onOpenUrl } from '@tauri-apps/plugin-deep-link';
|
||||
import { onOpenUrl, getCurrent } from '@tauri-apps/plugin-deep-link';
|
||||
import { start, cancel, onUrl, onInvalidUrl } from '@fabianlars/tauri-plugin-oauth';
|
||||
import { openUrl } from '@tauri-apps/plugin-opener';
|
||||
import { tauriHandleOnWindowFocus } from '@/utils/window';
|
||||
import { handleAuthCallback } from '@/helpers/auth';
|
||||
import { getOSPlatform } from '@/utils/misc';
|
||||
|
||||
@@ -90,7 +91,15 @@ export default function AuthPage() {
|
||||
openUrl(data.url);
|
||||
|
||||
// FIXME: For Android we need a better way to trigger the deeplink redirect
|
||||
if (getOSPlatform() === 'android') {
|
||||
if (isTauriAppPlatform() && osPlatform === 'android') {
|
||||
tauriHandleOnWindowFocus(async () => {
|
||||
const urls = await getCurrent();
|
||||
if (urls && urls.length > 0) {
|
||||
urls.forEach((url) => {
|
||||
handleOAuthUrl(url);
|
||||
});
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
router.back();
|
||||
}, 5000);
|
||||
|
||||
@@ -43,6 +43,8 @@ const LibraryHeader: React.FC<LibraryHeaderProps> = ({
|
||||
};
|
||||
}, [onToggleSelectMode]);
|
||||
|
||||
const windowButtonVisible = appService?.appPlatform !== 'web' && !isTrafficLightVisible;
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={headerRef}
|
||||
@@ -104,14 +106,12 @@ const LibraryHeader: React.FC<LibraryHeaderProps> = ({
|
||||
>
|
||||
<SettingsMenu />
|
||||
</Dropdown>
|
||||
{!isTrafficLightVisible && appService?.appPlatform !== 'web' && (
|
||||
<WindowButtons
|
||||
headerRef={headerRef}
|
||||
showMinimize={true}
|
||||
showMaximize={true}
|
||||
showClose={true}
|
||||
showMinimize={windowButtonVisible}
|
||||
showMaximize={windowButtonVisible}
|
||||
showClose={windowButtonVisible}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,3 +24,12 @@ export const tauriHandleOnCloseWindow = async (callback: () => void) => {
|
||||
await exit(0);
|
||||
});
|
||||
};
|
||||
|
||||
export const tauriHandleOnWindowFocus = async (callback: () => void) => {
|
||||
const { TauriEvent } = await import('@tauri-apps/api/event');
|
||||
const { getCurrentWindow } = await import('@tauri-apps/api/window');
|
||||
const currentWindow = getCurrentWindow();
|
||||
return currentWindow.listen(TauriEvent.WINDOW_FOCUS, async () => {
|
||||
await callback();
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user