Skip to content

Commit

Permalink
Add security context cache clearing;
Browse files Browse the repository at this point in the history
  • Loading branch information
stef-coenen committed Aug 22, 2024
1 parent d47b88f commit e70fd2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export const useSecurityContext = (odinId?: string, isEnabled?: boolean) => {
const fetch = async (odinId?: string) => {
if (
!odinId ||
odinId === window.location.hostname ||
(dotYouClient.getType() === ApiType.App && odinId === dotYouClient.getIdentity())
) {
return await getSecurityContext(dotYouClient);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useQueryClient } from '@tanstack/react-query';
import { AppPermissionType } from '@youfoundation/js-lib/network';
import { t, useMissingPermissions } from 'feed-app-common';
import { useEffect } from 'react';
Expand Down Expand Up @@ -31,6 +32,7 @@ export const ExtendPermissionDialog = ({
permissions: AppPermissionType[];
needsAllConnected?: boolean;
}) => {
const queryClient = useQueryClient();
const extendPermissionUrl = useMissingPermissions({
appId,
drives,
Expand All @@ -41,7 +43,8 @@ export const ExtendPermissionDialog = ({

useEffect(() => {
if (extendPermissionUrl) {
console.log('extendPermissionUrl', extendPermissionUrl);
queryClient.invalidateQueries({ queryKey: ['security-context'], exact: false });

Alert.alert(
t('Missing permissions'),
t(
Expand Down

0 comments on commit e70fd2d

Please sign in to comment.