release: Multi-Hoster-Upload v2.0.3
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
function createSettingsImportGate(isUploadRunning) {
|
||||
if (typeof isUploadRunning !== 'function') throw new TypeError('isUploadRunning must be a function');
|
||||
let importing = false;
|
||||
return {
|
||||
begin() {
|
||||
if (importing) throw new Error('Einstellungen werden bereits importiert');
|
||||
if (isUploadRunning()) throw new Error('Während laufender Uploads können keine Einstellungen importiert werden');
|
||||
importing = true;
|
||||
},
|
||||
end() {
|
||||
importing = false;
|
||||
},
|
||||
canStartUpload() {
|
||||
return !importing;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = { createSettingsImportGate };
|
||||
Reference in New Issue
Block a user