onthisday: allow disabling at top (fix #368)
parent
3fde5c1caf
commit
b584add525
|
@ -63,24 +63,20 @@ class PageController extends Controller
|
|||
|
||||
// Configuration
|
||||
$uid = $user->getUID();
|
||||
$this->initialState->provideInitialState('timelinePath', $this->config->getUserValue(
|
||||
$pi = function ($key, $default) use ($uid) {
|
||||
$this->initialState->provideInitialState($key, $this->config->getUserValue(
|
||||
$uid,
|
||||
Application::APPNAME,
|
||||
'timelinePath',
|
||||
'EMPTY'
|
||||
));
|
||||
$this->initialState->provideInitialState('foldersPath', $this->config->getUserValue(
|
||||
$uid,
|
||||
Application::APPNAME,
|
||||
'foldersPath',
|
||||
'/'
|
||||
));
|
||||
$this->initialState->provideInitialState('showHidden', $this->config->getUserValue(
|
||||
$uid,
|
||||
Application::APPNAME,
|
||||
'showHidden',
|
||||
false
|
||||
$key,
|
||||
$default
|
||||
));
|
||||
};
|
||||
|
||||
// User configuration
|
||||
$pi('timelinePath', 'EMPTY');
|
||||
$pi('foldersPath', '/');
|
||||
$pi('showHidden', false);
|
||||
$pi('enableTopMemories', "true");
|
||||
|
||||
// Apps enabled
|
||||
$this->initialState->provideInitialState('systemtags', true === $this->appManager->isEnabledForUser('systemtags'));
|
||||
|
|
|
@ -47,6 +47,14 @@
|
|||
>
|
||||
{{ t("memories", "Square grid mode") }}
|
||||
</NcCheckboxRadioSwitch>
|
||||
|
||||
<NcCheckboxRadioSwitch
|
||||
:checked.sync="config_enableTopMemories"
|
||||
@update:checked="updateEnableTopMemories"
|
||||
type="switch"
|
||||
>
|
||||
{{ t("memories", "Show past photos on top of timeline") }}
|
||||
</NcCheckboxRadioSwitch>
|
||||
</NcAppSettingsSection>
|
||||
|
||||
<NcAppSettingsSection
|
||||
|
@ -171,6 +179,10 @@ export default defineComponent({
|
|||
await this.updateSetting("squareThumbs");
|
||||
},
|
||||
|
||||
async updateEnableTopMemories() {
|
||||
await this.updateSetting("enableTopMemories");
|
||||
},
|
||||
|
||||
async updateShowHidden() {
|
||||
await this.updateSetting("showHidden");
|
||||
},
|
||||
|
|
|
@ -101,6 +101,9 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
async refresh() {
|
||||
// Skip if disabled
|
||||
if (!this.config_enableTopMemories) return;
|
||||
|
||||
// Look for cache
|
||||
const dayIdToday = utils.dateToDayId(new Date());
|
||||
const cacheUrl = `/onthisday/${dayIdToday}`;
|
||||
|
|
|
@ -21,8 +21,11 @@ export default defineComponent({
|
|||
"foldersPath",
|
||||
<string>"/"
|
||||
) as string,
|
||||
|
||||
config_showHidden:
|
||||
loadState("memories", "showHidden", <string>"false") === "true",
|
||||
config_enableTopMemories:
|
||||
loadState("memories", "enableTopMemories", <string>"false") === "true",
|
||||
|
||||
config_tagsEnabled: Boolean(
|
||||
loadState("memories", "systemtags", <string>"")
|
||||
|
|
|
@ -24,6 +24,7 @@ declare module "vue" {
|
|||
config_albumsEnabled: boolean;
|
||||
config_placesGis: number;
|
||||
config_squareThumbs: boolean;
|
||||
config_enableTopMemories: boolean;
|
||||
config_showFaceRect: boolean;
|
||||
config_eventName: string;
|
||||
|
||||
|
|
Loading…
Reference in New Issue