Skip to content

Updating options #4364

Answered by zadam
madodig asked this question in Q&A
Oct 30, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hi, updating the database via SQL doesn't notify the application, and the app doesn't constantly re-read everything from DB to see if something changed ...

The way to do this would be via backend script API.

Unfortunately there isn't an official API for working with options yet, but you can still access it via private API:

const themeOption = api.__private.becca.getOption('theme');
themeOption.value = 'your_theme';
themeOption.save();

However, note that specifically theme change needs a frontend reload anyway, since it involves loading new CSS ...

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@madodig
Comment options

@zadam
Comment options

Answer selected by madodig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants