mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-26 06:09:23 +00:00
add back ModeType to TopControls
This commit is contained in:
parent
1708a9b13b
commit
45d99777cc
@ -74,13 +74,13 @@ const TopControls = ({
|
|||||||
const mode = view as ModeType;
|
const mode = view as ModeType;
|
||||||
|
|
||||||
// Show immediate feedback
|
// Show immediate feedback
|
||||||
setSwitchingTo(mode);
|
setSwitchingTo(mode as ModeType);
|
||||||
|
|
||||||
// Defer the heavy view change to next frame so spinner can render
|
// Defer the heavy view change to next frame so spinner can render
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
// Give the spinner one more frame to show
|
// Give the spinner one more frame to show
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
setCurrentView(mode);
|
setCurrentView(mode as ModeType);
|
||||||
|
|
||||||
// Clear the loading state after view change completes
|
// Clear the loading state after view change completes
|
||||||
setTimeout(() => setSwitchingTo(null), 300);
|
setTimeout(() => setSwitchingTo(null), 300);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user