Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
bunsenstraat committed Jan 10, 2025
1 parent 916ac7f commit 0d04a3e
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 69 deletions.
4 changes: 1 addition & 3 deletions apps/remix-ide/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,7 @@ class AppComponent {
// activate solidity plugin
this.appManager.activatePlugin(['solidity', 'udapp', 'deploy-libraries', 'link-libraries', 'openzeppelin-proxy', 'scriptRunnerBridge'])

if(!isElectron()){

}else{
if(isElectron()){
this.appManager.activatePlugin(['desktopHost'])
}
}
Expand Down
6 changes: 3 additions & 3 deletions apps/remix-ide/src/app/components/DesktopClientUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface DesktopClientState {
currentContext: string;
}

const DesktopClientUI = (props: DesktopClientState & { openDesktopApp: () => {} } & { onConnect: (providerName: Provider) => void }) => {
const DesktopClientUI = (props: DesktopClientState & { openDesktopApp: () => void } & { onConnect: (providerName: Provider) => void }) => {
const appContext = useContext(AppContext);
const { connected, providers, onConnect, disableconnect, currentContext } = props;
const [title, setTitle] = React.useState('Connecting...');
Expand Down Expand Up @@ -84,8 +84,8 @@ const DesktopClientUI = (props: DesktopClientState & { openDesktopApp: () => {}
{disableconnect
? 'please wait ...'
: currentContext === provider.name
? 'Connected'
: 'Connect'}
? 'Connected'
: 'Connect'}
</button>
</div>
</div>
Expand Down
26 changes: 13 additions & 13 deletions apps/remix-ide/src/app/plugins/electron/desktopHostPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ import { ElectronPlugin } from '@remixproject/engine-electron'
const _paq = (window._paq = window._paq || [])

const profile = {
name: 'desktopHost',
displayName: '',
description: '',
methods: [],
events: ['connected'],
maintainedBy: 'Remix'
name: 'desktopHost',
displayName: '',
description: '',
methods: [],
events: ['connected'],
maintainedBy: 'Remix'
}

export class DesktopHost extends ElectronPlugin {

constructor() {
super(profile)
}
constructor() {
super(profile)
}

onActivation() {
console.log('DesktopHost activated')
_paq.push(['trackEvent', 'plugin', 'activated', 'DesktopHost'])
}
onActivation() {
console.log('DesktopHost activated')
_paq.push(['trackEvent', 'plugin', 'activated', 'DesktopHost'])
}

}
5 changes: 2 additions & 3 deletions apps/remix-ide/src/app/udapp/run-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { ForkedVMStateProvider } from '../providers/vm-provider'
import { Recorder } from '../tabs/runTab/model/recorder'
const _paq = (window._paq = window._paq || [])


export const providerDescriptions = {
'vm-cancun': 'Deploy to the in-browser virtual machine running the Cancun fork.',
'vm-shanghai': 'Deploy to the in-browser virtual machine running the Shanghai fork.',
Expand Down Expand Up @@ -216,7 +215,7 @@ export class RunTab extends ViewPlugin {
isInjected,
isVM,
isForkedState,
})
})
}

const addCustomInjectedProvider = async (position, event, name, displayName, networkId, urls, nativeCurrency?) => {
Expand Down Expand Up @@ -318,7 +317,7 @@ export class RunTab extends ViewPlugin {
// wallet connect
await addProvider(6, 'walletconnect', 'WalletConnect', false, false, false)

if(isElectron()) {
if (isElectron()) {
// desktop host
await addProvider(12, 'desktopHost', 'Metamask for Remix Desktop', false, false, false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ const ModalWrapper = (props: ModalWrapperProps) => {
})
break
case ModalTypes.fixed:
setState({
...props,
okFn: null,
cancelFn: null,
okLabel: null,
cancelLabel: null,
preventBlur: true,
hideCancelIcon: true,
})
break
setState({
...props,
okFn: null,
cancelFn: null,
okLabel: null,
cancelLabel: null,
preventBlur: true,
hideCancelIcon: true,
})
break
default:
setState({
...props,
Expand Down
62 changes: 31 additions & 31 deletions libs/remix-ui/app/src/lib/remix-app/reducer/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,44 @@ import { AppState } from "../interface";

export const appReducer = (state: AppState, action: AppAction): AppState => {
switch (action.type) {
case appActionTypes.setGitHubUser: {
return {
...state,
gitHubUser: action.payload
}
case appActionTypes.setGitHubUser: {
return {
...state,
gitHubUser: action.payload
}
case appActionTypes.setCurrentBranch: {
return {
...state,
currentBranch: action.payload
}
}
case appActionTypes.setCurrentBranch: {
return {
...state,
currentBranch: action.payload
}
case appActionTypes.setNeedsGitInit: {
return {
...state,
needsGitInit: action.payload
}
}
case appActionTypes.setNeedsGitInit: {
return {
...state,
needsGitInit: action.payload
}
case appActionTypes.setCanUseGit: {
return {
...state,
canUseGit: action.payload
}
}
case appActionTypes.setCanUseGit: {
return {
...state,
canUseGit: action.payload
}
}

case appActionTypes.setShowPopupPanel: {
return {
...state,
showPopupPanel: action.payload
}
case appActionTypes.setShowPopupPanel: {
return {
...state,
showPopupPanel: action.payload
}
}

case appActionTypes.setConnectedToDesktop: {
console.log('setConnectedToDesktop', action.payload)
return {
...state,
connectedToDesktop: action.payload
}
case appActionTypes.setConnectedToDesktop: {
console.log('setConnectedToDesktop', action.payload)
return {
...state,
connectedToDesktop: action.payload
}
}
}
}
4 changes: 2 additions & 2 deletions libs/remix-ui/app/src/lib/remix-app/remix-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const RemixApp = (props: IRemixAppUi) => {
})

useEffect(() => {
if(props.app.params && props.app.params.activate && props.app.params.activate.split(',').includes('desktopClient')){
if (props.app.params && props.app.params.activate && props.app.params.activate.split(',').includes('desktopClient')){
setHideSidePanel(true)
}
async function activateApp() {
Expand Down Expand Up @@ -119,7 +119,7 @@ const RemixApp = (props: IRemixAppUi) => {
},[appState.showPopupPanel])

function setListeners() {
if(!props.app.desktopClientMode){
if (!props.app.desktopClientMode){
props.app.sidePanel.events.on('toggle', () => {
setHideSidePanel((prev) => {
return !prev
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-ui/app/src/lib/remix-app/state/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export const appInitialState: AppState = {
canUseGit: false,
showPopupPanel: false,
connectedToDesktop: desktopConnextionType.disabled
}
}
2 changes: 1 addition & 1 deletion libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
}
}, [])

if(appContext.appState.connectedToDesktop != desktopConnextionType.disabled) {
if (appContext.appState.connectedToDesktop != desktopConnextionType.disabled) {
return (<></>)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function RemixUIStatusBar({ statusBarPlugin }: RemixUIStatusBarProps) {
return aiActive
}

if(platform !== appPlatformTypes.desktop && appContext.appState.connectedToDesktop !== desktopConnextionType.disabled) {
if (platform !== appPlatformTypes.desktop && appContext.appState.connectedToDesktop !== desktopConnextionType.disabled) {
return (<><div className="d-flex remixui_statusbar_height flex-row bg-warning justify-content-between align-items-center">
<DesktopStatus/></div></>)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function Home({ verticalIconPlugin }: HomeProps) {
<div
className="mt-2 my-1 remixui_homeIcon"
onClick={async () => {
if(appContext.appState.connectedToDesktop === desktopConnextionType.disabled) await verticalIconPlugin.activateHome()
if (appContext.appState.connectedToDesktop === desktopConnextionType.disabled) await verticalIconPlugin.activateHome()
}}
{...{ plugin: 'home' }}
data-id="verticalIconsHomeIcon"
Expand Down

0 comments on commit 0d04a3e

Please sign in to comment.