diff --git a/ElectronClient/run.sh b/ElectronClient/run.sh index bc86c359d6..7de1cf88b3 100755 --- a/ElectronClient/run.sh +++ b/ElectronClient/run.sh @@ -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 "$@" \ No newline at end of file diff --git a/ReactNativeClient/lib/BaseApplication.js b/ReactNativeClient/lib/BaseApplication.js index 5bdc2c0006..e1b962700b 100644 --- a/ReactNativeClient/lib/BaseApplication.js +++ b/ReactNativeClient/lib/BaseApplication.js @@ -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 '), '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); diff --git a/ReactNativeClient/lib/WelcomeUtils.js b/ReactNativeClient/lib/WelcomeUtils.js index 3277c306ec..91d5c958f7 100644 --- a/ReactNativeClient/lib/WelcomeUtils.js +++ b/ReactNativeClient/lib/WelcomeUtils.js @@ -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); diff --git a/ReactNativeClient/lib/models/Setting.js b/ReactNativeClient/lib/models/Setting.js index 41fb6635e5..0481dd811a 100644 --- a/ReactNativeClient/lib/models/Setting.js +++ b/ReactNativeClient/lib/models/Setting.js @@ -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_;