mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00
Add a .gitjournal.yaml file in a folder
This file will be added to save the settings of how we want that folder to behave. For example - default Editor, view, sorting mode, etc. This feature is currently disabled as it will only be a part of the pro mode.
This commit is contained in:
@ -8,8 +8,10 @@ import 'package:gitjournal/apis/git_migration.dart';
|
||||
import 'package:gitjournal/appstate.dart';
|
||||
import 'package:gitjournal/core/note.dart';
|
||||
import 'package:gitjournal/core/notes_cache.dart';
|
||||
import 'package:gitjournal/core/notes_folder.dart';
|
||||
import 'package:gitjournal/core/notes_folder_fs.dart';
|
||||
import 'package:gitjournal/core/git_repo.dart';
|
||||
import 'package:gitjournal/features.dart';
|
||||
import 'package:gitjournal/settings.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@ -235,6 +237,20 @@ class StateContainer with ChangeNotifier {
|
||||
});
|
||||
}
|
||||
|
||||
void saveFolderConfig(NotesFolderConfig config) async {
|
||||
if (!Features.perFolderConfig) {
|
||||
return;
|
||||
}
|
||||
|
||||
return _opLock.synchronized(() async {
|
||||
Fimber.d("State Container saveFolderConfig");
|
||||
await config.saveToFS();
|
||||
_gitRepo.addFolderConfig(config).then((NoteRepoResult _) {
|
||||
_syncNotes();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
void completeGitHostSetup() {
|
||||
() async {
|
||||
appState.remoteGitRepoConfigured = true;
|
||||
|
Reference in New Issue
Block a user