diff --git a/src/redux/actions.ts b/src/redux/actions.ts index d70f58e..6acfe18 100644 --- a/src/redux/actions.ts +++ b/src/redux/actions.ts @@ -78,6 +78,12 @@ export function renameDisc({ newName }: { newName: string }) { export function deleteTracks(indexes: number[]) { return async function(dispatch: AppDispatch) { + const confirmation = window.confirm( + `Proceed with Delete Track${indexes.length !== 1 ? 's' : ''}? This operation cannot be undone.` + ); + if (!confirmation) { + return; + } const { netmdService } = serviceRegistry; dispatch(appStateActions.setLoading(true)); indexes = indexes.sort(); @@ -91,6 +97,10 @@ export function deleteTracks(indexes: number[]) { export function wipeDisc() { return async function(dispatch: AppDispatch) { + const confirmation = window.confirm(`Proceed with Wipe Disc? This operation cannot be undone.`); + if (!confirmation) { + return; + } const { netmdService } = serviceRegistry; dispatch(appStateActions.setLoading(true)); await netmdService!.wipeDisc(); diff --git a/src/services/netmd-mock.ts b/src/services/netmd-mock.ts index b7f49b1..2f22e36 100644 --- a/src/services/netmd-mock.ts +++ b/src/services/netmd-mock.ts @@ -1,4 +1,4 @@ -import { Disc, Track, Encoding, Wireformat, TrackFlag } from 'netmd-js'; +import { Channels, Track, Encoding, Wireformat, TrackFlag } from 'netmd-js'; import { NetMDService } from './netmd'; import { sleep, sanitizeTitle } from '../utils'; import { assert } from 'netmd-js/dist/utils'; @@ -13,6 +13,7 @@ class NetMDMockService implements NetMDService { // duration: 5 * 60 * 512, // encoding: Encoding.sp, // index: 0, + // channel: Channels.stereo, // protected: TrackFlag.unprotected, // title: 'Mock Track 1', // }, @@ -20,6 +21,7 @@ class NetMDMockService implements NetMDService { // duration: 5 * 60 * 512, // encoding: Encoding.sp, // index: 1, + // channel: Channels.stereo, // protected: TrackFlag.unprotected, // title: 'Mock Track 2', // }, @@ -27,6 +29,7 @@ class NetMDMockService implements NetMDService { // duration: 5 * 60 * 512, // encoding: Encoding.sp, // index: 2, + // channel: Channels.stereo, // protected: TrackFlag.unprotected, // title: 'Mock Track 3', // }, @@ -34,6 +37,7 @@ class NetMDMockService implements NetMDService { // duration: 5 * 60 * 512, // encoding: Encoding.sp, // index: 3, + // channel: Channels.stereo, // protected: TrackFlag.unprotected, // title: 'Mock Track 4', // },