add out of space dialog #328

pull/581/head^2
Mikael Finstad 6 years ago
parent 73aec1225a
commit b9bde3b2bb

@ -50,7 +50,7 @@ import {
checkDirWriteAccess, dirExists, openDirToast, isMasBuild, isStoreBuild, dragPreventer, doesPlayerSupportFile,
isDurationValid, isWindows,
} from './util';
import { askForOutDir, askForImportChapters, createNumSegments, createFixedDurationSegments, promptTimeOffset, askForHtml5ifySpeed, askForYouTubeInput, askForFileOpenAction, confirmExtractAllStreamsDialog, cleanupFilesDialog } from './dialogs';
import { askForOutDir, askForImportChapters, createNumSegments, createFixedDurationSegments, promptTimeOffset, askForHtml5ifySpeed, askForYouTubeInput, askForFileOpenAction, confirmExtractAllStreamsDialog, cleanupFilesDialog, showDiskFull } from './dialogs';
import { openSendReportDialog } from './reporting';
import { fallbackLng } from './i18n';
import { createSegment, createInitialCutSegments, getCleanCutSegments, getSegApparentStart, findSegmentsAtCursor } from './segments';
@ -1101,6 +1101,11 @@ const App = memo(() => {
console.error('stderr:', err.stderr);
if (err.exitCode === 1 || err.code === 'ENOENT') {
// A bit hacky but it works, unless someone has a file called "No space left on device" ( ͡° ͜ʖ ͡°)
if (typeof err.stderr === 'string' && err.stderr.includes('No space left on device')) {
showDiskFull();
return;
}
handleCutFailed(err);
return;
}

@ -108,6 +108,13 @@ export async function askForFileOpenAction() {
return value;
}
export async function showDiskFull() {
await Swal.fire({
icon: 'error',
text: i18n.t('You ran out of space'),
});
}
export async function askForImportChapters() {
const { value } = await Swal.fire({
icon: 'question',

Loading…
Cancel
Save