From 7adb30f44f3b2961f477376fcc54c4375bdc3476 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 24 Aug 2024 14:26:08 +0200 Subject: [PATCH] rm unused events --- libs/remix-ui/git/src/components/github/devicecode.tsx | 2 -- libs/remix-ui/git/src/components/gitui.tsx | 6 ++---- .../git/src/components/panels/githubcredentials.tsx | 2 -- libs/remix-ui/git/src/lib/pluginActions.ts | 8 -------- libs/remix-ui/git/src/state/context.tsx | 2 -- 5 files changed, 2 insertions(+), 18 deletions(-) diff --git a/libs/remix-ui/git/src/components/github/devicecode.tsx b/libs/remix-ui/git/src/components/github/devicecode.tsx index 20281da15e..9ce3e5ec02 100644 --- a/libs/remix-ui/git/src/components/github/devicecode.tsx +++ b/libs/remix-ui/git/src/components/github/devicecode.tsx @@ -64,7 +64,6 @@ export const GetDeviceCode = () => { await actions.loadGitHubUserFromToken() } else { await sendToMatomo(gitMatomoEventTypes.CONNECTTOGITHUBFAIL) - pluginActions.disconnectFromGithub() } } @@ -74,7 +73,6 @@ export const GetDeviceCode = () => { setGitHubResponse(null) await pluginActions.saveToken(null) await actions.loadGitHubUserFromToken() - pluginActions.disconnectFromGithub() } return ( diff --git a/libs/remix-ui/git/src/components/gitui.tsx b/libs/remix-ui/git/src/components/gitui.tsx index 0fd8afc0e4..370f4d8d24 100644 --- a/libs/remix-ui/git/src/components/gitui.tsx +++ b/libs/remix-ui/git/src/components/gitui.tsx @@ -1,7 +1,7 @@ import React, { useContext, useEffect, useReducer, useState } from 'react' import { add, addall, checkout, checkoutfile, clone, commit, createBranch, remoteBranches, repositories, rm, getCommitChanges, diff, resolveRef, getBranchCommits, setUpstreamRemote, loadGitHubUserFromToken, getBranches, getRemotes, remoteCommits, saveGitHubCredentials, getGitHubCredentialsFromLocalStorage, fetch, pull, push, setDefaultRemote, addRemote, removeRemote, sendToGitLog, clearGitLog, getBranchDifferences, getFileStatusMatrix, init, showAlert, gitlog } from '../lib/gitactions' import { loadFiles, setCallBacks } from '../lib/listeners' -import { openDiff, openFile, saveToken, sendToMatomo, setModifiedDecorator, setPlugin, setUntrackedDecorator, statusChanged, disconnectFromGithub, logInGitHub } from '../lib/pluginActions' +import { openDiff, openFile, saveToken, sendToMatomo, setModifiedDecorator, setPlugin, setUntrackedDecorator, statusChanged } from '../lib/pluginActions' import { gitActionsContext, pluginActionsContext } from '../state/context' import { gitReducer } from '../state/gitreducer' import { defaultGitState, defaultLoaderState, gitMatomoEventTypes, gitState, gitUIPanels, loaderState } from '../types' @@ -162,9 +162,7 @@ export const GitUI = (props: IGitUi) => { saveToken, saveGitHubCredentials, getGitHubCredentialsFromLocalStorage, - showAlert, - disconnectFromGithub, - logInGitHub + showAlert } return ( diff --git a/libs/remix-ui/git/src/components/panels/githubcredentials.tsx b/libs/remix-ui/git/src/components/panels/githubcredentials.tsx index e6b8da65d8..65abc1797c 100644 --- a/libs/remix-ui/git/src/components/panels/githubcredentials.tsx +++ b/libs/remix-ui/git/src/components/panels/githubcredentials.tsx @@ -55,7 +55,6 @@ export const GitHubCredentials = () => { setGithubToken(credentials.token || '') setGithubUsername(credentials.username || '') setGithubEmail(credentials.email || '') - pluginactions.logInGitHub() } function removeToken(): void { @@ -67,7 +66,6 @@ export const GitHubCredentials = () => { email: '', token: '' }) - pluginactions.disconnectFromGithub() } return ( diff --git a/libs/remix-ui/git/src/lib/pluginActions.ts b/libs/remix-ui/git/src/lib/pluginActions.ts index d5bb0ada31..7d9e81ee7a 100644 --- a/libs/remix-ui/git/src/lib/pluginActions.ts +++ b/libs/remix-ui/git/src/lib/pluginActions.ts @@ -14,14 +14,6 @@ export const setPlugin = (p: Plugin, gitDispatcher: React.D loaderDispatch = loaderDispatcher } -export const disconnectFromGithub = () => { - plugin.emit('disconnectFromGithub') -} - -export const logInGitHub = () => { - plugin.emit('loggedInGithubChanged') -} - export const statusChanged = (badges: number) => { if (!plugin) return plugin.emit('statusChanged', { diff --git a/libs/remix-ui/git/src/state/context.tsx b/libs/remix-ui/git/src/state/context.tsx index 47d42f3439..4608406a7f 100644 --- a/libs/remix-ui/git/src/state/context.tsx +++ b/libs/remix-ui/git/src/state/context.tsx @@ -54,8 +54,6 @@ export interface pluginActions { token: string }> showAlert({ title, message }:{title: string, message: string}): Promise - logInGitHub(): void - disconnectFromGithub(): void } export const pluginActionsContext = React.createContext(null) \ No newline at end of file