|
|
@ -14,6 +14,7 @@ module.exports = class { |
|
|
|
channelName: "", |
|
|
|
date: "", |
|
|
|
data: "", |
|
|
|
sessionThresholdHours: 12, |
|
|
|
}, |
|
|
|
timezones: tz.names(), |
|
|
|
} |
|
|
@ -58,12 +59,24 @@ module.exports = class { |
|
|
|
return |
|
|
|
} |
|
|
|
} else if (input.importer === "MircLike") { |
|
|
|
this.state.error = "Date is required for mIRC-like logs" |
|
|
|
this.state.error = "Date is required for mIRC-like logs." |
|
|
|
return |
|
|
|
} else { |
|
|
|
input.date = null; |
|
|
|
} |
|
|
|
|
|
|
|
if (input.importer === "IRCCloudLog") { |
|
|
|
const hours = parseFloat(input.sessionThresholdHours) |
|
|
|
if (Number.isNaN(hours)) { |
|
|
|
this.state.error = "The session change threshold must be a number." |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
input.sessionThresholdMs = Math.floor(hours * 3600000) |
|
|
|
} |
|
|
|
|
|
|
|
delete input.sessionThresholdHours |
|
|
|
|
|
|
|
if (input.channelName.length < 2 || input.channelName.includes(" ") || input.channelName.includes(" ") || input.channelName.charAt(0) !== "#") { |
|
|
|
this.state.error = "A valid channelName name is required" |
|
|
|
return |
|
|
|