File tree Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,12 @@ public function __construct(
6868 return '. ' . $ out ;
6969 },
7070 ],
71+ 'loadRecentOnStartUp ' => [
72+ 'default ' => true ,
73+ 'validate ' => function ($ value ) {
74+ return $ value === 'true ' || $ value === true ;
75+ },
76+ ],
7177 ];
7278 }
7379
Original file line number Diff line number Diff line change @@ -139,7 +139,13 @@ export default {
139139 }
140140 if (data .notes !== null ) {
141141 this .error = false
142- this .routeDefault (data .lastViewedNote )
142+ console .log (' settings' , store .state .app .settings )
143+ if (store .state .app .settings ? .loadRecentOnStartUp ) {
144+ this .routeDefault (data .lastViewedNote )
145+ } else {
146+ this .routeWelcome ()
147+ }
148+
143149 } else if (this .loading .notes ) {
144150 // only show error state if not loading in background
145151 this .error = data .errorMessage
@@ -208,9 +214,13 @@ export default {
208214 if (availableNotes .length > 0 ) {
209215 this .routeToNote (availableNotes[0 ].id )
210216 } else {
211- if (this .$route .name !== ' welcome' ) {
212- this .$router .push ({ name: ' welcome' })
213- }
217+ this .routeWelcome ()
218+ }
219+ },
220+
221+ routeWelcome () {
222+ if (this .$route .name !== ' welcome' ) {
223+ this .$router .push ({ name: ' welcome' })
214224 }
215225 },
216226
Original file line number Diff line number Diff line change 3434 @click =" onChangeNotePath"
3535 >
3636 </NcAppSettingsSection >
37+ <NcAppSettingsSection id =" start-up-section" :name =" t('notes', 'Start Up')" >
38+ <NcCheckboxRadioSwitch :checked.sync =" settings.loadRecentOnStartUp" @update:checked =" onChangeSettings" >
39+ Load recently updated note on startup
40+ </NcCheckboxRadioSwitch >
41+ </NcAppSettingsSection >
3742 <NcAppSettingsSection id =" file-suffix-section" :name =" t('notes', 'File extension')" >
3843 <p class =" app-settings-section__desc" >
3944 {{ t('notes', 'File extension for new notes') }}
8792import {
8893 NcAppSettingsDialog ,
8994 NcAppSettingsSection ,
95+ NcCheckboxRadioSwitch ,
9096} from ' @nextcloud/vue'
9197
9298import { getFilePickerBuilder } from ' @nextcloud/dialogs'
@@ -101,6 +107,7 @@ export default {
101107 components: {
102108 NcAppSettingsDialog,
103109 NcAppSettingsSection,
110+ NcCheckboxRadioSwitch,
104111 HelpMobile,
105112 },
106113
@@ -192,6 +199,17 @@ export default {
192199 })
193200 },
194201
202+ onChangeStartUp (event ) {
203+ this .saving = true
204+ this .settings .loadRecentOnStartUp = event .target .checked
205+ return setSettings (this .settings )
206+ .catch (() => {
207+ })
208+ .then (() => {
209+ this .saving = false
210+ })
211+ },
212+
195213 setSettingsOpen (newValue ) {
196214 this .settingsOpen = newValue
197215 this .$emit (' update:open' , newValue)
You can’t perform that action at this time.
0 commit comments