diff --git a/apps/remix-ide/src/app/files/dgitProvider.ts b/apps/remix-ide/src/app/files/dgitProvider.ts index 8dfd9b6784..cdb863b4b7 100644 --- a/apps/remix-ide/src/app/files/dgitProvider.ts +++ b/apps/remix-ide/src/app/files/dgitProvider.ts @@ -101,10 +101,9 @@ class DGitProvider extends Plugin { } async status(cmd: statusInput): Promise> { - console.log('status', cmd) + if ((Registry.getInstance().get('platform').api.isDesktop())) { const status = await this.call('isogit', 'status', cmd) - console.log('STATUS', { ...status }) return status } @@ -112,7 +111,7 @@ class DGitProvider extends Plugin { ...await this.addIsomorphicGitConfigFS(), ...cmd }) - console.log('STATUS', JSON.stringify(status)) + return status } @@ -131,7 +130,7 @@ class DGitProvider extends Plugin { } async rm(cmd: rmInputType) { - console.log('RM', cmd) + if ((Registry.getInstance().get('platform').api.isDesktop())) { await this.call('isogit', 'rm', cmd) } else { @@ -144,7 +143,7 @@ class DGitProvider extends Plugin { } async checkout(cmd: checkoutInputType): Promise { - console.log('checkout', cmd) + if ((Registry.getInstance().get('platform').api.isDesktop())) { await this.call('isogit', 'checkout', cmd) } else { @@ -185,12 +184,12 @@ class DGitProvider extends Plugin { } async log(cmd: logInputType): Promise { - console.log('LOG', cmd) + if ((Registry.getInstance().get('platform').api.isDesktop())) { const status = await this.call('isogit', 'log', { ...cmd, }) - console.log('LOG END', status) + return status } @@ -198,7 +197,7 @@ class DGitProvider extends Plugin { ...await this.addIsomorphicGitConfigFS(), ...cmd, }) - console.log('LOG END', status) + return status } @@ -260,7 +259,6 @@ class DGitProvider extends Plugin { if ((Registry.getInstance().get('platform').api.isDesktop())) { const branches = await this.call('isogit', 'branches') - console.log(branches) return branches } const defaultConfig = await this.addIsomorphicGitConfigFS() @@ -618,7 +616,7 @@ class DGitProvider extends Plugin { } async remotecommits(input: remoteCommitsInputType): Promise { - console.log('remotecommits', input) + const octokit = new Octokit({ auth: input.token }) diff --git a/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx b/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx index fcad46ffc9..7aa8705e2a 100644 --- a/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx +++ b/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx @@ -1,15 +1,15 @@ -import {faArrowDown, faArrowUp, faArrowsUpDown, faArrowRotateRight} from '@fortawesome/free-solid-svg-icons' -import {FontAwesomeIcon} from '@fortawesome/react-fontawesome' -import {CustomTooltip} from '@remix-ui/helper' -import React, {useEffect, useState} from 'react' -import {FormattedMessage} from 'react-intl' -import {gitActionsContext} from '../../state/context' -import {branch, remote} from '@remix-api' -import {defaultGitState, gitMatomoEventTypes, gitUIPanels} from '../../types' -import {gitPluginContext} from '../gitui' +import { faArrowDown, faArrowUp, faArrowsUpDown, faArrowRotateRight } from '@fortawesome/free-solid-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { CustomTooltip } from '@remix-ui/helper' +import React, { useEffect, useState } from 'react' +import { FormattedMessage } from 'react-intl' +import { gitActionsContext } from '../../state/context' +import { branch, remote } from '@remix-api' +import { defaultGitState, gitMatomoEventTypes, gitUIPanels } from '../../types' +import { gitPluginContext } from '../gitui' import GitUIButton from './gituibutton' -import {syncStateContext} from './sourceControlBase' -import {sendToMatomo} from '../../lib/pluginActions' +import { syncStateContext } from './sourceControlBase' +import { sendToMatomo } from '../../lib/pluginActions' export interface SourceControlButtonsProps { panel: string diff --git a/libs/remix-ui/git/src/lib/gitactions.ts b/libs/remix-ui/git/src/lib/gitactions.ts index 7ced95da51..5c9bbe9638 100644 --- a/libs/remix-ui/git/src/lib/gitactions.ts +++ b/libs/remix-ui/git/src/lib/gitactions.ts @@ -65,7 +65,7 @@ export const setUpstreamRemote = async (remote: remote) => { } export const getFileStatusMatrix = async (filepaths: string[]) => { - console.log('getFileStatusMatrix', filepaths) + dispatch(setLoading(true)) const fileStatusResult = await statusMatrix(filepaths); fileStatusResult.map((m) => { @@ -81,7 +81,7 @@ export const getFileStatusMatrix = async (filepaths: string[]) => { dispatch(fileStatusMerge(fileStatusResult)) setFileDecorators(fileStatusResult) } - console.log('getFileStatusMatrix end') + dispatch(setLoading(false)) } @@ -93,7 +93,7 @@ export const getCommits = async (depth: number) => { "log", { ref: "HEAD", depth: depth } ); - console.log('commits', commits) + return commits; } catch (e) { return []; @@ -101,7 +101,7 @@ export const getCommits = async (depth: number) => { } export const gitlog = async (depth: number) => { - console.log('gitlog start') + let commits = [] try { commits = await getCommits(depth) @@ -110,7 +110,7 @@ export const gitlog = async (depth: number) => { dispatch(setCommits(commits)) await showCurrentBranch() dispatch(setLoading(false)) - console.log('gitlog end') + } export const setStateGitLogCount = async (count: number) => { @@ -533,7 +533,7 @@ export const remoteBranches = async (owner: string, repo: string) => { } export const remoteCommits = async (url: string, branch: string, length: number) => { - console.log('get remote commits') + const urlParts = url.split("/"); // check if it's github @@ -680,9 +680,9 @@ export const loadGitHubUserFromToken = async () => { } export const statusMatrix = async (filepaths: string[]) => { - console.log('calling status') + const matrix = await plugin.call('dgitApi', 'status', { ref: "HEAD", filepaths: filepaths || ['.']}); - console.log('calling status end') + const result = (matrix || []).map((x) => { return { filename: `/${x.shift()}`, @@ -745,7 +745,7 @@ export const diff = async (commitChange: commitChange) => { } export const getCommitChanges = async (oid1: string, oid2: string, branch?: branch, remote?: remote) => { - console.log('getCommitChanges', oid1, oid2, branch, remote) + try { let log try { @@ -758,7 +758,7 @@ export const getCommitChanges = async (oid1: string, oid2: string, branch?: bran console.log(e, 'log error') } if (log) { - console.log('log', log) + const foundCommit = log.find((commit: ReadCommitResult) => commit.oid === oid2) if (!foundCommit && remote) { @@ -795,7 +795,7 @@ async function getRepoDetails(url: string) { } export const fetchBranch = async (branch: branch, page: number) => { - console.log('fetch branch') + if (!branch.remote || !branch.remote.url) return const token = await tokenWarning(); if (page == 1) { @@ -815,7 +815,7 @@ export const fetchBranch = async (branch: branch, page: number) => { } export const getBranchDifferences = async (branch: branch, remote: remote, state: gitState) => { - console.log('get branch diff') + if (!remote && state) { if (state.defaultRemote) { remote = state.defaultRemote diff --git a/libs/remix-ui/git/src/lib/listeners.ts b/libs/remix-ui/git/src/lib/listeners.ts index cb8377e055..42f450c058 100644 --- a/libs/remix-ui/git/src/lib/listeners.ts +++ b/libs/remix-ui/git/src/lib/listeners.ts @@ -69,11 +69,11 @@ export const setCallBacks = (viewPlugin: Plugin, gitDispatcher: React.Dispatch { - console.log('workingDirChanged', path) + gitDispatcher(setDesktopWorkingDir(path)) gitDispatch(setCanUseApp(path ? true : false)) const version = await plugin.call('dgitApi', 'version') - console.log(version) + gitDispatch(setVersion(version)) loadFileQueue.enqueue(async () => { loadFiles() @@ -90,13 +90,12 @@ export const setCallBacks = (viewPlugin: Plugin, gitDispatcher: React.Dispatch { - console.log('setWorkspace', x) if (platform == appPlatformTypes.desktop) { const workingDir = await plugin.call('fs', 'getWorkingDir') gitDispatch(setCanUseApp(workingDir? true : false)) const version = await plugin.call('dgitApi', 'version') - console.log(version) + gitDispatch(setVersion(version)) } else { gitDispatch(setCanUseApp(x && !x.isLocalhost && x.name)) @@ -144,7 +143,7 @@ export const setCallBacks = (viewPlugin: Plugin, gitDispatcher: React.Dispatch { - console.log('commit') + loadFileQueue.enqueue(async () => { loadFiles() }, 10)