diff --git a/apps/app-frontend/src/App.vue b/apps/app-frontend/src/App.vue index 668c557a86..93b805ad8d 100644 --- a/apps/app-frontend/src/App.vue +++ b/apps/app-frontend/src/App.vue @@ -125,6 +125,7 @@ import { get as getInstance, get_global_synced_options, run, + set_global_synced_option, } from '@/helpers/instance' import { get as getCreds, @@ -151,7 +152,7 @@ import { } from '@/helpers/utils.js' import { start_join_server, start_join_singleplayer_world } from '@/helpers/worlds.ts' import i18n from '@/i18n.config' -import { instanceKeys } from '@/pages/instance/query-options' +import { instanceKeys, screenshotKeys } from '@/pages/instance/query-options' import { appUpdateState, downloadAvailableAppUpdate, @@ -1116,6 +1117,25 @@ watch( settings.hide_nametag_skins_page = behavior.hide_nametag settingsChanged = true } + + const showAllScreenshots = behavior.show_all_screenshots + if (typeof showAllScreenshots === 'boolean') { + const globalSyncedOptions = + globalSyncedOptionsQuery.data.value ?? + (await queryClient.fetchQuery({ + queryKey: ['global-synced-options'], + queryFn: get_global_synced_options, + })) + if (globalSyncedOptions.screenshots !== showAllScreenshots) { + const updatedGlobalSyncedOptions = await set_global_synced_option( + 'screenshots', + showAllScreenshots, + ) + queryClient.setQueryData(['global-synced-options'], updatedGlobalSyncedOptions) + await queryClient.invalidateQueries({ queryKey: screenshotKeys.all }) + } + } + for (const [flag, value] of Object.entries(behaviorFeatureFlags)) { if (settings.feature_flags[flag] !== value) { settings.feature_flags[flag] = value diff --git a/apps/app-frontend/src/components/ui/screenshots-page/card.vue b/apps/app-frontend/src/components/ui/screenshots-page/card.vue index adf1222ef8..f1de4c6532 100644 --- a/apps/app-frontend/src/components/ui/screenshots-page/card.vue +++ b/apps/app-frontend/src/components/ui/screenshots-page/card.vue @@ -3,11 +3,16 @@ @@ -91,7 +166,7 @@ watch( ref="card" role="button" tabindex="0" - class="group relative aspect-video min-w-0 cursor-pointer overflow-hidden rounded-xl border border-solid border-surface-5 bg-surface-2 p-0 text-left shadow-sm transition-[filter] hover:brightness-110 focus-visible:outline focus-visible:outline-2 focus-visible:outline-brand" + class="group relative isolate aspect-video min-w-0 cursor-pointer overflow-hidden rounded-xl border border-solid border-surface-5 bg-surface-2 p-0 text-left shadow-sm transition-[filter] hover:brightness-110 focus-visible:outline focus-visible:outline-2 focus-visible:outline-brand" :class="{ '!border-contrast brightness-110': selected, '!border-brand ring-2 ring-brand animate-pulse': highlighted, @@ -115,7 +190,7 @@ watch( > -