mirror of
https://github.com/stashapp/stash.git
synced 2025-12-15 12:52:38 +01:00
Update browser cache when images are updated (#389)
This commit is contained in:
parent
41f7a46ac1
commit
c8a56aea40
2 changed files with 8 additions and 0 deletions
|
|
@ -88,6 +88,10 @@ export const Studio: FunctionComponent<IProps> = (props: IProps) => {
|
|||
try {
|
||||
if (!isNew) {
|
||||
const result = await updateStudio();
|
||||
if (image) {
|
||||
// Refetch image to bust browser cache
|
||||
await fetch(`/studio/${result.data.studioUpdate.id}/image`, { cache: "reload" });
|
||||
}
|
||||
setStudio(result.data.studioUpdate);
|
||||
} else {
|
||||
const result = await createStudio();
|
||||
|
|
|
|||
|
|
@ -59,6 +59,10 @@ export const Performer: FunctionComponent<IPerformerProps> = (props: IPerformerP
|
|||
try {
|
||||
if (!isNew) {
|
||||
const result = await updatePerformer({variables: performer as GQL.PerformerUpdateInput});
|
||||
if (performer.image) {
|
||||
// Refetch image to bust browser cache
|
||||
await fetch(`/performer/${result.data.performerUpdate.id}/image`, { cache: "reload" });
|
||||
}
|
||||
setPerformer(result.data.performerUpdate);
|
||||
} else {
|
||||
const result = await createPerformer({variables: performer as GQL.PerformerCreateInput});
|
||||
|
|
|
|||
Loading…
Reference in a new issue