mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-11 18:24:43 +02:00
Desktop, CLI: Added option to disable creation of welcome items
This commit is contained in:
parent
9c85bc2cd1
commit
553a26eb63
@ -4,7 +4,7 @@ cd "$ROOT_DIR"
|
||||
./build.sh || exit 1
|
||||
cd "$ROOT_DIR/app"
|
||||
|
||||
./node_modules/.bin/electron . --env dev --log-level debug --open-dev-tools "$@"
|
||||
./node_modules/.bin/electron . --env dev --log-level debug --no-welcome --open-dev-tools "$@"
|
||||
|
||||
# ./node_modules/.bin/electron . --profile ~/Temp/TestJoplin1 --env dev --log-level debug --open-dev-tools "$@"
|
||||
# ./node_modules/.bin/electron . --profile ~/Temp/TestJoplin2 --env dev --log-level debug --open-dev-tools "$@"
|
@ -112,6 +112,12 @@ class BaseApplication {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (arg == '--no-welcome') {
|
||||
matched.welcomeDisabled = true;
|
||||
argv.splice(0, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (arg == '--env') {
|
||||
if (!nextArg) throw new JoplinError(_('Usage: %s', '--env <dev|prod>'), 'flagError');
|
||||
matched.env = nextArg;
|
||||
@ -575,6 +581,8 @@ class BaseApplication {
|
||||
setLocale(Setting.value('locale'));
|
||||
}
|
||||
|
||||
if ('welcomeDisabled' in initArgs) Setting.setValue('welcome.enabled', !initArgs.welcomeDisabled);
|
||||
|
||||
if (!Setting.value('api.token')) {
|
||||
EncryptionService.instance().randomHexString(64).then((token) => {
|
||||
Setting.setValue('api.token', token);
|
||||
|
@ -60,6 +60,11 @@ class WelcomeUtils {
|
||||
}
|
||||
|
||||
static async install(dispatch) {
|
||||
if (!Setting.value('welcome.enabled')) {
|
||||
Setting.setValue('welcome.wasBuilt', true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Setting.value('welcome.wasBuilt')) {
|
||||
const result = await WelcomeUtils.createWelcomeItems();
|
||||
Setting.setValue('welcome.wasBuilt', true);
|
||||
|
@ -201,6 +201,7 @@ class Setting extends BaseModel {
|
||||
'revisionService.oldNoteInterval': { section: 'revisionService', value: 1000 * 60 * 60 * 24 * 7, type: Setting.TYPE_INT, public: false },
|
||||
|
||||
'welcome.wasBuilt': { value: false, type: Setting.TYPE_BOOL, public: false },
|
||||
'welcome.enabled': { value: true, type: Setting.TYPE_BOOL, public: false },
|
||||
};
|
||||
|
||||
return this.metadata_;
|
||||
|
Loading…
Reference in New Issue
Block a user