Fix share token for public share pages
Some checks are pending
Create docker images (cloud) / Build, push, and deploy (push) Waiting to run
Node.js CI / build (push) Waiting to run

This commit is contained in:
Mike Cao 2026-02-04 17:32:03 -08:00
parent 6c7b6bab07
commit 5267222a67
2 changed files with 7 additions and 1 deletions

View file

@ -1,4 +1,4 @@
import { setShare, useApp } from '@/store/app';
import { setShare, setShareToken, useApp } from '@/store/app';
import { useApi } from '../useApi';
const selector = state => state.share;
@ -12,6 +12,7 @@ export function useShareTokenQuery(slug: string) {
const data = await get(`/share/${slug}`);
setShare(data);
setShareToken({ token: data?.token });
return data;
},

View file

@ -17,6 +17,7 @@ const initialState = {
timezone: getItem(TIMEZONE_CONFIG) || getTimezone(),
dateRangeValue: getItem(DATE_RANGE_CONFIG) || DEFAULT_DATE_RANGE_VALUE,
share: null,
shareToken: null,
user: null,
config: null,
};
@ -35,6 +36,10 @@ export function setShare(share: object) {
store.setState({ share });
}
export function setShareToken(shareToken: { token?: string } | null) {
store.setState({ shareToken });
}
export function setUser(user: object) {
store.setState({ user });
}