1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

Desktop: Select Welcome notebook the first time it is created

This commit is contained in:
Laurent Cozic
2019-02-08 23:38:29 +00:00
parent 4326902683
commit 0567188fa8
6 changed files with 50 additions and 8 deletions

View File

@ -14,6 +14,10 @@ class WelcomeUtils {
static async createWelcomeItems() {
const overwriteExisting = Setting.value('env') === 'dev';
const output = {
defaultFolderId: null,
};
const noteAssets = welcomeAssets.notes;
const folderAssets = welcomeAssets.folders;
const tempDir = Setting.value('resourceDir');
@ -21,11 +25,14 @@ class WelcomeUtils {
// TODO: Update mobile root.js
// TODO: Update CLI
// TODO: Test CLI
// TODO: Use less tags?
for (let i = 0; i < folderAssets.length; i++) {
const folderAsset = folderAssets[i];
const folderId = folderAsset.id;
if (!output.defaultFolderId) output.defaultFolderId = folderId;
let existingFolder = await Folder.load(folderId);
if (existingFolder && overwriteExisting) {
@ -93,6 +100,8 @@ class WelcomeUtils {
if (noteAsset.tags) await Tag.setNoteTagsByTitles(noteId, noteAsset.tags);
}
return output;
}
}