🎨 Extract magic number to a constant

This commit is contained in:
Philipp Stracker 2025-02-07 16:13:02 +01:00
parent 66dddcff8b
commit ca4fc6acbd
No known key found for this signature in database

View file

@ -7,6 +7,9 @@ import { useSaveSettings } from '../../../../hooks/useSaveSettings';
import { CommonHooks } from '../../../../data';
import TabBar from '../../../ReusableComponents/TabBar';
// How long the save confirmation stays visible, in milliseconds.
const SAVE_CONFIRMATION_DURATION = 2500;
const SettingsNavigation = ( {
canSave = true,
tabs,
@ -92,7 +95,7 @@ const SaveStateMessage = () => {
// Restart the hide-timer, when the message is visible.
refHideTimer.current = setTimeout( () => {
setShowMessage( false );
}, 2500 );
}, SAVE_CONFIRMATION_DURATION );
}, [ showMessage, isSaving ] );
if ( ! showMessage ) {