Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix synchronizer invalid calls #4208

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading