Skip to content

Commit

Permalink
Merge pull request #4208 from kubeshop/f1ames/fix/synchronizer-invali…
Browse files Browse the repository at this point in the history
…d-calls

fix: fix synchronizer invalid calls
  • Loading branch information
WitoDelnat authored Jan 4, 2024
2 parents 9aae267 + 178b830 commit 8b0ec34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions electron/app/services/cloud/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {getUser} from './user';
export const getPolicy = async (repoPath: string) => {
const synchronizer = await getSynchronizer();
const user = await getUser();
if (!user?.token || !synchronizer) {
if (!user?.tokenInfo || !synchronizer) {
return null;
}

try {
const policy = await synchronizer.getPolicy(repoPath, true, user.token);
const policy = await synchronizer.getPolicy(repoPath, true, user.tokenInfo);
return policy;
} catch (e: any) {
if (e instanceof Error) {
Expand Down
4 changes: 2 additions & 2 deletions electron/app/services/cloud/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export const getInfo = async (
): Promise<{projectInfo: CloudProjectInfo; policyInfo: CloudPolicyInfo} | null> => {
const synchronizer = await getSynchronizer();
const user = await getUser();
if (!user?.token || !synchronizer) {
if (!user?.tokenInfo || !synchronizer) {
return null;
}

try {
const project = await synchronizer?.getProjectInfo(repoPath, user.token, true);
const project = await synchronizer?.getProjectInfo(repoPath, user.tokenInfo, true);
return project
? {
projectInfo: {...project, link: synchronizer.generateDeepLinkProject(project.slug)},
Expand Down

0 comments on commit 8b0ec34

Please sign in to comment.