Skip to content

Commit

Permalink
notify about enable full waveform #260
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Apr 19, 2023
1 parent 34b9576 commit 8632b34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,6 @@ const App = memo(() => {
}
}, [detectedFileFormat, outFormatLocked, setFileFormat, setOutFormatLocked]);

const toggleWaveformMode = useCallback((newMode) => {
if (waveformMode === 'waveform') {
setWaveformMode('big-waveform');
} else if (waveformMode === 'big-waveform') {
setWaveformMode();
} else {
setWaveformMode(newMode);
}
}, [waveformMode]);

const toggleEnableThumbnails = useCallback(() => setThumbnailsEnabled((v) => !v), []);

const toggleExportConfirmEnabled = useCallback(() => setExportConfirmEnabled((v) => {
Expand Down Expand Up @@ -253,6 +243,17 @@ const App = memo(() => {

const hideAllNotifications = hideNotifications === 'all';

const toggleWaveformMode = useCallback(() => {
if (waveformMode === 'waveform') {
setWaveformMode('big-waveform');
} else if (waveformMode === 'big-waveform') {
setWaveformMode();
} else {
if (!hideAllNotifications) toast.fire({ text: i18n.t('Mini-waveform has been enabled. Click again to enable full-screen waveform') });
setWaveformMode('waveform');
}
}, [hideAllNotifications, waveformMode]);

const toggleSafeOutputFileName = useCallback(() => setSafeOutputFileName((v) => {
if (v && !hideAllNotifications) toast.fire({ icon: 'info', text: i18n.t('Output file name will not be sanitized, and any special characters will be preserved. This may cause the export to fail and can cause other funny issues. Use at your own risk!') });
return !v;
Expand Down
2 changes: 1 addition & 1 deletion src/BottomBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const BottomBar = memo(({
style={{ padding: '0 .1em', color: ['big-waveform', 'waveform'].includes(waveformMode) ? primaryTextColor : undefined }}
role="button"
title={t('Show waveform')}
onClick={() => toggleWaveformMode('waveform')}
onClick={() => toggleWaveformMode()}
/>
)}
{hasVideo && (
Expand Down

0 comments on commit 8632b34

Please sign in to comment.