mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Force reload of custom css if it's updated (#1073)
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
* Allow configuration of visible navbar items.
|
* Allow configuration of visible navbar items.
|
||||||
|
|
||||||
### 🎨 Improvements
|
### 🎨 Improvements
|
||||||
|
* Refresh UI when changing custom CSS options.
|
||||||
* Add batch deleting of performers, tags, studios, and movies.
|
* Add batch deleting of performers, tags, studios, and movies.
|
||||||
* Reset cache after scan/clean to ensure scenes are updated.
|
* Reset cache after scan/clean to ensure scenes are updated.
|
||||||
* Add more video/image resolution tags.
|
* Add more video/image resolution tags.
|
||||||
|
|||||||
@@ -60,10 +60,22 @@ export const SettingsInterfacePanel: React.FC = () => {
|
|||||||
}, [config]);
|
}, [config]);
|
||||||
|
|
||||||
async function onSave() {
|
async function onSave() {
|
||||||
|
const prevCSS = config?.configuration.interface.css;
|
||||||
|
const prevCSSenabled = config?.configuration.interface.cssEnabled;
|
||||||
try {
|
try {
|
||||||
const result = await updateInterfaceConfig();
|
const result = await updateInterfaceConfig();
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(result);
|
console.log(result);
|
||||||
|
|
||||||
|
// Force refetch of custom css if it was changed
|
||||||
|
if (
|
||||||
|
prevCSS !== result.data?.configureInterface.css ||
|
||||||
|
prevCSSenabled !== result.data?.configureInterface.cssEnabled
|
||||||
|
) {
|
||||||
|
await fetch("/css", { cache: "reload" });
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
Toast.success({ content: "Updated config" });
|
Toast.success({ content: "Updated config" });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Toast.error(e);
|
Toast.error(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user