mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 13:29:02 +08:00
feat: bump eslint & oxlint (#14452)
#### PR Dependency Tree * **PR #14452** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved null-safety, dependency tracking, upload validation, and error logging for more reliable uploads, clipboard, calendar linking, telemetry, PDF/theme printing, and preview/zoom behavior. * Tightened handling of all-day calendar events (missing date now reported). * **Deprecations** * Removed deprecated RadioButton and RadioButtonGroup; use RadioGroup. * **Chores** * Unified and upgraded linting/config, reorganized imports, and standardized binary handling for more consistent builds and tooling. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
+3
-2
@@ -157,14 +157,13 @@ const CalDAVLinkDialog = ({
|
||||
setErrors(nextErrors);
|
||||
return;
|
||||
}
|
||||
|
||||
setSubmitting(true);
|
||||
try {
|
||||
await gqlService.gql({
|
||||
query: linkCalDavAccountMutation,
|
||||
variables: {
|
||||
input: {
|
||||
providerPresetId: selectedProvider!.id,
|
||||
providerPresetId: selectedProvider.id,
|
||||
username: username.trim(),
|
||||
password,
|
||||
displayName: displayName.trim() || null,
|
||||
@@ -416,6 +415,7 @@ export const IntegrationsPanel = () => {
|
||||
urlService.openExternal(data.linkCalendarAccount);
|
||||
setOpenedExternalWindow(true);
|
||||
} catch (error) {
|
||||
console.error('Failed to link calendar account', error);
|
||||
notify.error({
|
||||
title: t['com.affine.integration.calendar.auth.start-error'](),
|
||||
});
|
||||
@@ -456,6 +456,7 @@ export const IntegrationsPanel = () => {
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
console.error('Failed to unlink calendar account', error);
|
||||
notify.error({
|
||||
title: t['com.affine.integration.calendar.account.unlink-error'](),
|
||||
});
|
||||
|
||||
@@ -15,6 +15,7 @@ import { Avatar } from '@affine/component/ui/avatar';
|
||||
import { useAsyncCallback } from '@affine/core/components/hooks/affine-async-hooks';
|
||||
import { useNavigateHelper } from '@affine/core/components/hooks/use-navigate-helper';
|
||||
import { BackupService } from '@affine/core/modules/backup/services';
|
||||
import { toArrayBuffer } from '@affine/core/utils/array-buffer';
|
||||
import { i18nTime, useI18n } from '@affine/i18n';
|
||||
import track from '@affine/track';
|
||||
import {
|
||||
@@ -47,7 +48,7 @@ const BlobAvatar = ({
|
||||
const [url, setUrl] = useState<string | null>(null);
|
||||
useEffect(() => {
|
||||
if (!blob) return;
|
||||
const url = URL.createObjectURL(new Blob([blob]));
|
||||
const url = URL.createObjectURL(new Blob([toArrayBuffer(blob)]));
|
||||
setUrl(url);
|
||||
return () => {
|
||||
URL.revokeObjectURL(url);
|
||||
|
||||
+1
@@ -75,6 +75,7 @@ export const CalendarSettingPanel = () => {
|
||||
}));
|
||||
await calendar.updateWorkspaceCalendars(items);
|
||||
} catch (error) {
|
||||
console.error('Failed to save calendar settings', error);
|
||||
notify.error({
|
||||
title: t['com.affine.integration.calendar.save-error'](),
|
||||
});
|
||||
|
||||
+1
@@ -73,6 +73,7 @@ export const SelfHostTeamCard = () => {
|
||||
license?.expiredAt || 0
|
||||
).toLocaleDateString(),
|
||||
leftDays: Math.floor(
|
||||
// eslint-disable-next-line react-hooks/purity
|
||||
(new Date(license?.expiredAt || 0).getTime() - Date.now()) /
|
||||
(1000 * 60 * 60 * 24)
|
||||
).toLocaleString(),
|
||||
|
||||
@@ -104,7 +104,7 @@ export const Component = () => {
|
||||
const [searchParams] = useSearchParams();
|
||||
const [message, setMessage] = useState('');
|
||||
const [error, setError] = useState('');
|
||||
const [retryKey, setRetryKey] = useState(0);
|
||||
const [retryCount, setRetryCount] = useState(0);
|
||||
const { jumpToSignIn, jumpToIndex } = useNavigateHelper();
|
||||
const idempotencyKey = useMemo(() => nanoid(), []);
|
||||
|
||||
@@ -115,9 +115,10 @@ export const Component = () => {
|
||||
const call = effect(
|
||||
switchMap(() => {
|
||||
return fromPromise(async signal => {
|
||||
retryKey;
|
||||
// TODO(@eyhn): i18n
|
||||
setMessage('Checking account status...');
|
||||
setMessage(
|
||||
`Checking account status...${retryCount > 0 ? ` (retry ${retryCount})` : ''}`
|
||||
);
|
||||
setError('');
|
||||
await authService.session.waitForRevalidation(signal);
|
||||
const loggedIn =
|
||||
@@ -179,7 +180,7 @@ export const Component = () => {
|
||||
plan,
|
||||
jumpToIndex,
|
||||
recurring,
|
||||
retryKey,
|
||||
retryCount,
|
||||
variant,
|
||||
coupon,
|
||||
urlService,
|
||||
@@ -197,7 +198,7 @@ export const Component = () => {
|
||||
<>
|
||||
{error}
|
||||
<br />
|
||||
<Button variant="primary" onClick={() => setRetryKey(i => i + 1)}>
|
||||
<Button variant="primary" onClick={() => setRetryCount(i => i + 1)}>
|
||||
Retry
|
||||
</Button>
|
||||
</>
|
||||
|
||||
@@ -5,8 +5,8 @@ import {
|
||||
type ChatContextValue,
|
||||
} from '@affine/core/blocksuite/ai/components/ai-chat-content';
|
||||
import type { ChatStatus } from '@affine/core/blocksuite/ai/components/ai-chat-messages';
|
||||
import type { AIChatToolbar } from '@affine/core/blocksuite/ai/components/ai-chat-toolbar';
|
||||
import {
|
||||
AIChatToolbar,
|
||||
configureAIChatToolbar,
|
||||
getOrCreateAIChatToolbar,
|
||||
} from '@affine/core/blocksuite/ai/components/ai-chat-toolbar';
|
||||
|
||||
@@ -6,8 +6,8 @@ import {
|
||||
type ChatContextValue,
|
||||
} from '@affine/core/blocksuite/ai/components/ai-chat-content';
|
||||
import type { ChatStatus } from '@affine/core/blocksuite/ai/components/ai-chat-messages';
|
||||
import type { AIChatToolbar } from '@affine/core/blocksuite/ai/components/ai-chat-toolbar';
|
||||
import {
|
||||
AIChatToolbar,
|
||||
configureAIChatToolbar,
|
||||
getOrCreateAIChatToolbar,
|
||||
} from '@affine/core/blocksuite/ai/components/ai-chat-toolbar';
|
||||
|
||||
@@ -253,21 +253,19 @@ const WorkspacePage = ({ meta }: { meta: WorkspaceMetadata }) => {
|
||||
};
|
||||
}, [meta, workspacesService]);
|
||||
|
||||
const isRootDocReady =
|
||||
useLiveData(
|
||||
useMemo(
|
||||
() =>
|
||||
workspace
|
||||
? LiveData.from(
|
||||
workspace.engine.doc
|
||||
.docState$(workspace.id)
|
||||
.pipe(map(v => v.ready)),
|
||||
false
|
||||
)
|
||||
: null,
|
||||
[workspace]
|
||||
)
|
||||
) ?? false;
|
||||
const rootDocReady$ = useMemo(
|
||||
() =>
|
||||
workspace
|
||||
? LiveData.from(
|
||||
workspace.engine.doc
|
||||
.docState$(workspace.id)
|
||||
.pipe(map(v => v.ready)),
|
||||
false
|
||||
)
|
||||
: null,
|
||||
[workspace]
|
||||
);
|
||||
const isRootDocReady = useLiveData(rootDocReady$) ?? false;
|
||||
|
||||
useEffect(() => {
|
||||
if (workspace) {
|
||||
|
||||
Reference in New Issue
Block a user