Skip to content

Commit

Permalink
fix: map theme auth in shared links (#8359)
Browse files Browse the repository at this point in the history
fix: map theme auth
  • Loading branch information
jrasm91 committed Mar 29, 2024
1 parent fcc3b81 commit 25c9b77
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
6 changes: 4 additions & 2 deletions mobile/openapi/doc/SystemConfigApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions mobile/openapi/lib/api/system_config_api.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mobile/openapi/test/system_config_api_test.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions open-api/immich-openapi-specs.json
Expand Up @@ -5348,6 +5348,14 @@
"get": {
"operationId": "getMapStyle",
"parameters": [
{
"name": "key",
"required": false,
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "theme",
"required": true,
Expand Down
4 changes: 3 additions & 1 deletion open-api/typescript-sdk/src/fetch-client.ts
Expand Up @@ -2422,13 +2422,15 @@ export function getConfigDefaults(opts?: Oazapfts.RequestOpts) {
...opts
}));
}
export function getMapStyle({ theme }: {
export function getMapStyle({ key, theme }: {
key?: string;
theme: MapTheme;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: object;
}>(`/system-config/map/style.json${QS.query(QS.explode({
key,
theme
}))}`, {
...opts
Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/components/shared-components/map/map.svelte
Expand Up @@ -2,7 +2,7 @@
import Icon from '$lib/components/elements/icon.svelte';
import { Theme } from '$lib/constants';
import { colorTheme, mapSettings } from '$lib/stores/preferences.store';
import { getAssetThumbnailUrl, handlePromiseError } from '$lib/utils';
import { getAssetThumbnailUrl, getKey, handlePromiseError } from '$lib/utils';
import { getMapStyle, MapTheme, type MapMarkerResponseDto } from '@immich/sdk';
import { mdiCog, mdiMapMarker } from '@mdi/js';
import type { Feature, GeoJsonProperties, Geometry, Point } from 'geojson';
Expand Down Expand Up @@ -50,6 +50,7 @@
$: style = (() =>
getMapStyle({
theme: ($mapSettings.allowDarkMode ? $colorTheme.value : Theme.LIGHT) as unknown as MapTheme,
key: getKey(),
}) as Promise<StyleSpecification>)();
const dispatch = createEventDispatcher<{
Expand Down

0 comments on commit 25c9b77

Please sign in to comment.