From 30100b39ef946aee25532d5aec78bd529f786220 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 5 Jun 2024 06:49:50 +0200 Subject: [PATCH] lint --- libs/remix-ui/git/src/components/gitui.tsx | 2 +- libs/remix-ui/git/src/lib/gitactions.ts | 5 +---- .../src/lib/components/homeTabGetStarted.tsx | 12 ++++++------ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/libs/remix-ui/git/src/components/gitui.tsx b/libs/remix-ui/git/src/components/gitui.tsx index 8ffe815571..d14943da5c 100644 --- a/libs/remix-ui/git/src/components/gitui.tsx +++ b/libs/remix-ui/git/src/components/gitui.tsx @@ -99,7 +99,7 @@ export const GitUI = (props: IGitUi) => { useEffect(() => { if (!appLoaded) return async function updatestate() { - + if (gitState.currentBranch && gitState.currentBranch.remote && gitState.currentBranch.remote.url) { remoteCommits(gitState.currentBranch.remote.url, gitState.currentBranch.name, 1) } diff --git a/libs/remix-ui/git/src/lib/gitactions.ts b/libs/remix-ui/git/src/lib/gitactions.ts index adbc1a79ca..fdb090242e 100644 --- a/libs/remix-ui/git/src/lib/gitactions.ts +++ b/libs/remix-ui/git/src/lib/gitactions.ts @@ -58,7 +58,7 @@ export const getBranches = async () => { dispatch(setBranches(branches)); } export const getRemotes = async () => { - + const remotes: remote[] = await plugin.call('dgitApi', "remotes"); dispatch(setRemotes(remotes)); @@ -116,7 +116,6 @@ export const showCurrentBranch = async () => { try { const branch = await currentBranch(); - dispatch(setCanCommit((branch && branch.name !== ""))); dispatch(setCurrentBranch(branch)); @@ -490,7 +489,6 @@ export const remoteBranches = async (owner: string, repo: string) => { export const remoteCommits = async (url: string, branch: string, length: number) => { const urlParts = url.split("/"); - // check if it's github if (!urlParts[urlParts.length - 3].includes('github')) { return @@ -564,7 +562,6 @@ export const loadGitHubUserFromToken = async () => { emails: userEmails } = await plugin.call('dgitApi' as any, 'getGitHubUser', { token }); - if (data && data.emails && data.user && data.user.login) { const primaryEmail = data.emails.find(email => email.primary) diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx index ff7153dcbd..7275b90616 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx @@ -73,12 +73,12 @@ function HomeTabGetStarted({ plugin }: HomeTabGetStartedProps) { if (metadata) { if (metadata.type === 'git') { - await (plugin as Plugin).call('dgitApi', 'clone', - { - url: metadata.url, - branch: metadata.branch, - workspaceName: templateDisplayName - }) + await (plugin as Plugin).call('dgitApi', 'clone', + { + url: metadata.url, + branch: metadata.branch, + workspaceName: templateDisplayName + }) } else if (metadata && metadata.type === 'plugin') { await plugin.appManager.activatePlugin('filePanel') templateDisplayName = await plugin.call('filePanel', 'getAvailableWorkspaceName', templateDisplayName)