|
@@ -3,7 +3,7 @@ import useSWR, { SWRConfiguration, SWRResponse } from 'swr';
|
|
|
|
|
|
|
|
import { IExternalAccount } from '~/interfaces/external-account';
|
|
import { IExternalAccount } from '~/interfaces/external-account';
|
|
|
import { IUser } from '~/interfaces/user';
|
|
import { IUser } from '~/interfaces/user';
|
|
|
-import { useCurrentUser } from '~/stores/context';
|
|
|
|
|
|
|
+import { useIsGuestUser } from '~/stores/context';
|
|
|
import loggerFactory from '~/utils/logger';
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
|
|
import { apiv3Get, apiv3Put } from '../client/util/apiv3-client';
|
|
import { apiv3Get, apiv3Put } from '../client/util/apiv3-client';
|
|
@@ -14,9 +14,9 @@ const logger = loggerFactory('growi:stores:personal-settings');
|
|
|
|
|
|
|
|
|
|
|
|
|
export const useSWRxPersonalSettings = (config?: SWRConfiguration): SWRResponse<IUser, Error> => {
|
|
export const useSWRxPersonalSettings = (config?: SWRConfiguration): SWRResponse<IUser, Error> => {
|
|
|
- const { data: currrentUser } = useCurrentUser();
|
|
|
|
|
|
|
+ const { data: isGuestUser } = useIsGuestUser();
|
|
|
|
|
|
|
|
- const key = currrentUser != null ? '/personal-setting' : null;
|
|
|
|
|
|
|
+ const key = !isGuestUser ? '/personal-setting' : null;
|
|
|
|
|
|
|
|
return useSWR(
|
|
return useSWR(
|
|
|
key,
|
|
key,
|