diff --git a/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx b/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx index 7882d1c749..ce70ae3170 100644 --- a/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx +++ b/libs/remix-ui/git/src/components/buttons/sourcecontrolbuttons.tsx @@ -41,6 +41,10 @@ export const SourceControlButtons = () => { await actions.push(getRemoteName(), branch ? branch.name : context.currentBranch.name) } + const refresh = async() => { + actions.getFileStatusMatrix(null) + } + const buttonsDisabled = () => { return (!context.upstream) || context.remotes.length === 0 } @@ -76,7 +80,7 @@ export const SourceControlButtons = () => { }> - { }} className='btn btn-sm'> + diff --git a/libs/remix-ui/git/src/components/gitui.tsx b/libs/remix-ui/git/src/components/gitui.tsx index 4df8228682..de8c0e034e 100644 --- a/libs/remix-ui/git/src/components/gitui.tsx +++ b/libs/remix-ui/git/src/components/gitui.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useReducer, useState } from 'react' -import { add, addall, checkout, checkoutfile, clone, commit, createBranch, remoteBranches, repositories, rm, getCommitChanges, diff, resolveRef, getBranchCommits, setUpstreamRemote, getGitHubUser, getBranches, getRemotes, remoteCommits, saveGitHubCredentials, getGitHubCredentials, fetch, pull, push, setDefaultRemote, addRemote, removeRemote, sendToGitLog, clearGitLog, getBranchDifferences } from '../lib/gitactions' +import { add, addall, checkout, checkoutfile, clone, commit, createBranch, remoteBranches, repositories, rm, getCommitChanges, diff, resolveRef, getBranchCommits, setUpstreamRemote, getGitHubUser, getBranches, getRemotes, remoteCommits, saveGitHubCredentials, getGitHubCredentials, fetch, pull, push, setDefaultRemote, addRemote, removeRemote, sendToGitLog, clearGitLog, getBranchDifferences, getFileStatusMatrix } from '../lib/gitactions' import { loadFiles, setCallBacks } from '../lib/listeners' import { openDiff, openFile, saveToken, setModifiedDecorator, setPlugin, setUntrackedDecorator, statusChanged } from '../lib/pluginActions' import { gitActionsContext, pluginActionsContext } from '../state/context' @@ -111,7 +111,8 @@ export const GitUI = (props: IGitUi) => { addRemote, removeRemote, sendToGitLog, - clearGitLog + clearGitLog, + getFileStatusMatrix } const pluginActionsProviderValue = { diff --git a/libs/remix-ui/git/src/state/context.tsx b/libs/remix-ui/git/src/state/context.tsx index b50ff4d9f3..636c3fd5d5 100644 --- a/libs/remix-ui/git/src/state/context.tsx +++ b/libs/remix-ui/git/src/state/context.tsx @@ -30,6 +30,7 @@ export interface gitActions { addRemote: (remote: remote) => Promise sendToGitLog: (message: gitLog) => Promise clearGitLog: () => Promise + getFileStatusMatrix(filespaths:[]): Promise } export const gitActionsContext = React.createContext(null)