feat: configure toast timeout - #62689
Open
kristian-zendato wants to merge 1 commit into
Open
Conversation
Signed-off-by: Kristian Zendato <kristian.zendato@nextcloud.com>
kristian-zendato
requested review from
Altahrim,
leftybournes,
nfebe,
skjnldsv and
sorbaugh
and removed request for
a team
July 30, 2026 11:14
CarlSchwan
reviewed
Jul 30, 2026
| $this->initialState->provideLazyInitialState('toastTimeout', function () { | ||
| if ($this->userSession->getUser()) { | ||
| $uid = $this->userSession->getUser()->getUID(); | ||
| $value = $this->config->getUserValue($uid, Application::APP_ID, 'toast_timeout', '7000'); |
Member
There was a problem hiding this comment.
please use IUserConfig in new code
Contributor
There was a problem hiding this comment.
Yes and ideally config lexicon
| return false; | ||
| }); | ||
|
|
||
| $this->initialState->provideLazyInitialState('toastTimeout', function () { |
Member
There was a problem hiding this comment.
Suggested change
| $this->initialState->provideLazyInitialState('toastTimeout', function () { | |
| $this->initialState->provideLazyInitialState('toastTimeout', function (): int { |
| * | ||
| * @var string[] | ||
| */ | ||
| public const TOAST_TIMEOUT_VALUES = ['15000', '30000', '-1']; |
Member
There was a problem hiding this comment.
Suggested change
| public const TOAST_TIMEOUT_VALUES = ['15000', '30000', '-1']; | |
| public const array TOAST_TIMEOUT_VALUES = ['15000', '30000', '-1']; |
susnux
reviewed
Jul 30, 2026
susnux
left a comment
Contributor
There was a problem hiding this comment.
seems to be ok, but its an integer. So there is no reason to store it as string.
Especially for new code the proper type should directly be used.
| * | ||
| * @var string[] | ||
| */ | ||
| public const TOAST_TIMEOUT_VALUES = ['15000', '30000', '-1']; |
| $this->initialState->provideLazyInitialState('toastTimeout', function () { | ||
| if ($this->userSession->getUser()) { | ||
| $uid = $this->userSession->getUser()->getUID(); | ||
| $value = $this->config->getUserValue($uid, Application::APP_ID, 'toast_timeout', '7000'); |
Contributor
There was a problem hiding this comment.
Same here please use the correct type, there is no reason for string
| $this->initialState->provideLazyInitialState('toastTimeout', function () { | ||
| if ($this->userSession->getUser()) { | ||
| $uid = $this->userSession->getUser()->getUID(); | ||
| $value = $this->config->getUserValue($uid, Application::APP_ID, 'toast_timeout', '7000'); |
Contributor
There was a problem hiding this comment.
Yes and ideally config lexicon
Comment on lines
+22
to
+27
| const TOAST_TIMEOUT_DEFAULT = String(TOAST_DEFAULT_TIMEOUT) | ||
| const TOAST_TIMEOUT_15S = '15000' | ||
| const TOAST_TIMEOUT_30S = '30000' | ||
| const TOAST_TIMEOUT_NEVER = String(TOAST_PERMANENT_TIMEOUT) | ||
|
|
||
| const toastTimeout = ref(String(loadState('theming', 'toastTimeout', TOAST_DEFAULT_TIMEOUT))) |
Contributor
There was a problem hiding this comment.
As mentioned above there is no reason for string type, this is an int so also pass it as integer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a personal theming setting to configure how long toast notifications remain visible.
Checklist
3. to review, feature component)stable32)AI (if applicable)