pull/4791/head
filip mertens 6 months ago
parent 2dd6e7dec6
commit 30100b39ef
  1. 2
      libs/remix-ui/git/src/components/gitui.tsx
  2. 5
      libs/remix-ui/git/src/lib/gitactions.ts
  3. 12
      libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx

@ -99,7 +99,7 @@ export const GitUI = (props: IGitUi) => {
useEffect(() => { useEffect(() => {
if (!appLoaded) return if (!appLoaded) return
async function updatestate() { async function updatestate() {
if (gitState.currentBranch && gitState.currentBranch.remote && gitState.currentBranch.remote.url) { if (gitState.currentBranch && gitState.currentBranch.remote && gitState.currentBranch.remote.url) {
remoteCommits(gitState.currentBranch.remote.url, gitState.currentBranch.name, 1) remoteCommits(gitState.currentBranch.remote.url, gitState.currentBranch.name, 1)
} }

@ -58,7 +58,7 @@ export const getBranches = async () => {
dispatch(setBranches(branches)); dispatch(setBranches(branches));
} }
export const getRemotes = async () => { export const getRemotes = async () => {
const remotes: remote[] = await plugin.call('dgitApi', "remotes"); const remotes: remote[] = await plugin.call('dgitApi', "remotes");
dispatch(setRemotes(remotes)); dispatch(setRemotes(remotes));
@ -116,7 +116,6 @@ export const showCurrentBranch = async () => {
try { try {
const branch = await currentBranch(); const branch = await currentBranch();
dispatch(setCanCommit((branch && branch.name !== ""))); dispatch(setCanCommit((branch && branch.name !== "")));
dispatch(setCurrentBranch(branch)); 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) => { export const remoteCommits = async (url: string, branch: string, length: number) => {
const urlParts = url.split("/"); const urlParts = url.split("/");
// check if it's github // check if it's github
if (!urlParts[urlParts.length - 3].includes('github')) { if (!urlParts[urlParts.length - 3].includes('github')) {
return return
@ -564,7 +562,6 @@ export const loadGitHubUserFromToken = async () => {
emails: userEmails emails: userEmails
} = await plugin.call('dgitApi' as any, 'getGitHubUser', { token }); } = await plugin.call('dgitApi' as any, 'getGitHubUser', { token });
if (data && data.emails && data.user && data.user.login) { if (data && data.emails && data.user && data.user.login) {
const primaryEmail = data.emails.find(email => email.primary) const primaryEmail = data.emails.find(email => email.primary)

@ -73,12 +73,12 @@ function HomeTabGetStarted({ plugin }: HomeTabGetStartedProps) {
if (metadata) { if (metadata) {
if (metadata.type === 'git') { if (metadata.type === 'git') {
await (plugin as Plugin<any, CustomRemixApi>).call('dgitApi', 'clone', await (plugin as Plugin<any, CustomRemixApi>).call('dgitApi', 'clone',
{ {
url: metadata.url, url: metadata.url,
branch: metadata.branch, branch: metadata.branch,
workspaceName: templateDisplayName workspaceName: templateDisplayName
}) })
} else if (metadata && metadata.type === 'plugin') { } else if (metadata && metadata.type === 'plugin') {
await plugin.appManager.activatePlugin('filePanel') await plugin.appManager.activatePlugin('filePanel')
templateDisplayName = await plugin.call('filePanel', 'getAvailableWorkspaceName', templateDisplayName) templateDisplayName = await plugin.call('filePanel', 'getAvailableWorkspaceName', templateDisplayName)

Loading…
Cancel
Save