Fix a mutation that should have been a query
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
b2a40d15fa
commit
98b8b3338c
|
@ -158,7 +158,7 @@ export const PRIVACY = gql`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const TIMEZONES = gql`
|
export const TIMEZONES = gql`
|
||||||
query {
|
query Timezones {
|
||||||
config {
|
config {
|
||||||
timezones
|
timezones
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ export const TIMEZONES = gql`
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const WEB_PUSH = gql`
|
export const WEB_PUSH = gql`
|
||||||
query {
|
query WebPush {
|
||||||
config {
|
config {
|
||||||
webPush {
|
webPush {
|
||||||
enabled
|
enabled
|
||||||
|
|
|
@ -22,8 +22,8 @@ export async function subscribeUserToPush(): Promise<PushSubscription | null> {
|
||||||
apolloProvider.defaultClient as ApolloClient<NormalizedCacheObject>;
|
apolloProvider.defaultClient as ApolloClient<NormalizedCacheObject>;
|
||||||
|
|
||||||
const registration = await navigator.serviceWorker.ready;
|
const registration = await navigator.serviceWorker.ready;
|
||||||
const { data } = await client.mutate<{ config: IConfig }>({
|
const { data } = await client.query<{ config: IConfig }>({
|
||||||
mutation: WEB_PUSH,
|
query: WEB_PUSH,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (data?.config?.webPush?.enabled && data?.config?.webPush?.publicKey) {
|
if (data?.config?.webPush?.enabled && data?.config?.webPush?.publicKey) {
|
||||||
|
|
Loading…
Reference in a new issue