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(
68
68
return '. ' . $ out ;
69
69
},
70
70
],
71
+ 'loadRecentOnStartUp ' => [
72
+ 'default ' => true ,
73
+ 'validate ' => function ($ value ) {
74
+ return $ value === 'true ' || $ value === true ;
75
+ },
76
+ ],
71
77
];
72
78
}
73
79
Original file line number Diff line number Diff line change @@ -139,7 +139,13 @@ export default {
139
139
}
140
140
if (data .notes !== null ) {
141
141
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
+
143
149
} else if (this .loading .notes ) {
144
150
// only show error state if not loading in background
145
151
this .error = data .errorMessage
@@ -208,9 +214,13 @@ export default {
208
214
if (availableNotes .length > 0 ) {
209
215
this .routeToNote (availableNotes[0 ].id )
210
216
} 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' })
214
224
}
215
225
},
216
226
Original file line number Diff line number Diff line change 34
34
@click =" onChangeNotePath"
35
35
>
36
36
</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 >
37
42
<NcAppSettingsSection id =" file-suffix-section" :name =" t('notes', 'File extension')" >
38
43
<p class =" app-settings-section__desc" >
39
44
{{ t('notes', 'File extension for new notes') }}
87
92
import {
88
93
NcAppSettingsDialog ,
89
94
NcAppSettingsSection ,
95
+ NcCheckboxRadioSwitch ,
90
96
} from ' @nextcloud/vue'
91
97
92
98
import { getFilePickerBuilder } from ' @nextcloud/dialogs'
@@ -101,6 +107,7 @@ export default {
101
107
components: {
102
108
NcAppSettingsDialog,
103
109
NcAppSettingsSection,
110
+ NcCheckboxRadioSwitch,
104
111
HelpMobile,
105
112
},
106
113
@@ -192,6 +199,17 @@ export default {
192
199
})
193
200
},
194
201
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
+
195
213
setSettingsOpen (newValue ) {
196
214
this .settingsOpen = newValue
197
215
this .$emit (' update:open' , newValue)
You can’t perform that action at this time.
0 commit comments