mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-08-06 15:21:21 +08:00
Note: minor cleanup
This commit is contained in:
@ -53,9 +53,7 @@ enum NoteType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class NoteFileFormatInfo {
|
class NoteFileFormatInfo {
|
||||||
static List<String> allowedExtensions() {
|
static List<String> allowedExtensions = ['.md', '.org', '.txt'];
|
||||||
return ['.md', '.org', '.txt'];
|
|
||||||
}
|
|
||||||
|
|
||||||
static String defaultExtension(NoteFileFormat format) {
|
static String defaultExtension(NoteFileFormat format) {
|
||||||
switch (format) {
|
switch (format) {
|
||||||
@ -72,11 +70,13 @@ class NoteFileFormatInfo {
|
|||||||
|
|
||||||
static bool isAllowedFileName(String filePath) {
|
static bool isAllowedFileName(String filePath) {
|
||||||
var noteFilePath = filePath.toLowerCase();
|
var noteFilePath = filePath.toLowerCase();
|
||||||
var isMarkdownFile = noteFilePath.endsWith('.md');
|
for (var ext in allowedExtensions) {
|
||||||
var isTxtFile = noteFilePath.endsWith('.txt');
|
if (noteFilePath.endsWith(ext)) {
|
||||||
var isOrgFile = noteFilePath.endsWith('.org');
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return isMarkdownFile || isTxtFile || isOrgFile;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user