summaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-04-27 11:15:48 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-07-05 16:20:33 +0200
commita0597da460f10245c3081dc263857bb575eaeda0 (patch)
treee8fdb08b638926b1f976b32a5c0c503a5f93fae2 /apps/files/lib
parentf029c8bd82e94479fef047f1147d025a523bcba7 (diff)
downloadnextcloud-server-a0597da460f10245c3081dc263857bb575eaeda0.tar.gz
nextcloud-server-a0597da460f10245c3081dc263857bb575eaeda0.zip
feat(files): sort favorites first
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/Service/UserConfig.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files/lib/Service/UserConfig.php b/apps/files/lib/Service/UserConfig.php
index e405b02c07a..c39719ae8ed 100644
--- a/apps/files/lib/Service/UserConfig.php
+++ b/apps/files/lib/Service/UserConfig.php
@@ -41,6 +41,12 @@ class UserConfig {
'default' => false,
'allowed' => [true, false],
],
+ [
+ // Whether to sort favorites first in the list or not
+ 'key' => 'sort_favorites_first',
+ 'default' => true,
+ 'allowed' => [true, false],
+ ],
];
protected IConfig $config;
@@ -133,7 +139,7 @@ class UserConfig {
$userConfigs = array_map(function(string $key) use ($userId) {
$value = $this->config->getUserValue($userId, Application::APP_ID, $key, $this->getDefaultConfigValue($key));
// If the default is expected to be a boolean, we need to cast the value
- if (is_bool($this->getDefaultConfigValue($key))) {
+ if (is_bool($this->getDefaultConfigValue($key)) && is_string($value)) {
return $value === '1';
}
return $value;