mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
fix: move traffic lights based on zoom level (#6201)
<div class='graphite__hidden'>
<div>🎥 Video uploaded on Graphite:</div>
<a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/f75d1f6f-18f4-4dff-8174-67223f5f9807.mp4">
<img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/f75d1f6f-18f4-4dff-8174-67223f5f9807.mp4">
</a>
</div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/f75d1f6f-18f4-4dff-8174-67223f5f9807.mp4">Kapture 2024-03-19 at 18.05.20.mp4</video>
This commit is contained in:
@@ -4,6 +4,7 @@ import './edgeless-template';
|
||||
import { apis, events } from '@affine/electron-api';
|
||||
import { setupGlobal } from '@affine/env/global';
|
||||
import * as Sentry from '@sentry/react';
|
||||
import { debounce } from 'lodash-es';
|
||||
import { useEffect } from 'react';
|
||||
import {
|
||||
createRoutesFromChildren,
|
||||
@@ -61,6 +62,11 @@ export function setup() {
|
||||
};
|
||||
apis?.ui.isMaximized().then(handleMaximized).catch(console.error);
|
||||
events?.ui.onMaximized(handleMaximized);
|
||||
|
||||
const handleResize = debounce(() => {
|
||||
apis?.ui.handleWindowResize().catch(console.error);
|
||||
}, 50);
|
||||
window.addEventListener('resize', handleResize);
|
||||
}
|
||||
|
||||
performanceSetupLogger.info('done');
|
||||
|
||||
Reference in New Issue
Block a user