mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-01 17:22:42 +00:00
rename handleAutoSave to toggleAutoSave
This commit is contained in:
@@ -332,7 +332,7 @@ const EditPage = (props) => {
|
|||||||
return <Nav.item className='save saved'>saved.</Nav.item>;
|
return <Nav.item className='save saved'>saved.</Nav.item>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAutoSave = () => {
|
const toggleAutoSave = () => {
|
||||||
if (warningTimer.current) clearTimeout(warningTimer.current);
|
if (warningTimer.current) clearTimeout(warningTimer.current);
|
||||||
localStorage.setItem('AUTOSAVE_ON', JSON.stringify(!autoSaveEnabled));
|
localStorage.setItem('AUTOSAVE_ON', JSON.stringify(!autoSaveEnabled));
|
||||||
setAutoSaveEnabled(!autoSaveEnabled);
|
setAutoSaveEnabled(!autoSaveEnabled);
|
||||||
@@ -345,7 +345,7 @@ const EditPage = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderAutoSaveButton = () => (
|
const renderAutoSaveButton = () => (
|
||||||
<Nav.item onClick={handleAutoSave}>
|
<Nav.item onClick={toggleAutoSave}>
|
||||||
Autosave <i className={autoSaveEnabled ? 'fas fa-power-off active' : 'fas fa-power-off'}></i>
|
Autosave <i className={autoSaveEnabled ? 'fas fa-power-off active' : 'fas fa-power-off'}></i>
|
||||||
</Nav.item>
|
</Nav.item>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user