mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-28 14:45:16 -07:00
- Introduced useGenerationForm hook to streamline audio generation form handling, including validation and model download management. - Updated FloatingGenerateBox and GenerationForm components to utilize the new hook, enhancing code organization and reducing duplication. - Replaced console logging with a debug utility for better logging control during audio playback and generation processes. - Improved error handling in HistoryTable and MainEditor components by integrating toast notifications for user feedback. - Adjusted audio recording duration limits across various components for consistency.
20 lines
335 B
TypeScript
20 lines
335 B
TypeScript
const DEBUG = import.meta.env.DEV;
|
|
|
|
export const debug = {
|
|
log: (...args: unknown[]) => {
|
|
if (DEBUG) {
|
|
console.log(...args);
|
|
}
|
|
},
|
|
error: (...args: unknown[]) => {
|
|
if (DEBUG) {
|
|
console.error(...args);
|
|
}
|
|
},
|
|
warn: (...args: unknown[]) => {
|
|
if (DEBUG) {
|
|
console.warn(...args);
|
|
}
|
|
},
|
|
};
|