fix key prop error

pull/5370/head
Joseph Izang 6 months ago
parent a9074fc7b4
commit e463f8dba2
  1. 2
      libs/remix-ui/statusbar/src/lib/components/scamDetails.tsx
  2. 24
      libs/remix-ui/statusbar/src/lib/remixui-statusbar-panel.tsx

@ -25,7 +25,7 @@ export default function ScamDetails ({ refs, floatStyle, scamAlerts }: ScamDetai
</span>
<div className="d-flex flex-column text-white">
{scamAlerts && scamAlerts.map((alert, index) => (
<span className="pl-4 mt-1">
<span className="pl-4 mt-1" key={`${alert.url}${index}`}>
{alert.url.length < 1 ? <FormattedMessage id={`home.scamAlertText${index + 1}`} defaultMessage={alert.message} />
: (<><FormattedMessage id={`home.scamAlertText${index + 1}`} defaultMessage={alert.message} /> : &nbsp;
<a

@ -7,6 +7,7 @@ import ScamDetails from './components/scamDetails'
import { FloatingFocusManager, autoUpdate, flip, offset, shift, useClick, useDismiss, useFloating, useInteractions, useRole } from '@floating-ui/react'
import axios from 'axios'
import { get } from 'lodash'
import { current } from '@reduxjs/toolkit'
export interface RemixUIStatusBarProps {
statusBarPlugin: StatusBarInterface
@ -53,26 +54,31 @@ export function RemixUIStatusBar({ statusBarPlugin }: RemixUIStatusBarProps) {
}
}, [])
useEffect(() => {
async function getGitBranchName() {
const gitRepo = await statusBarPlugin.call('fileManager', 'isGitRepo')
console.log('gitRepo', gitRepo)
return gitRepo
}
async function getWorkspaceName() {
console.log(statusBarPlugin)
const workspaceObject = await statusBarPlugin.call('filePanel', 'getCurrentWorkspace')
if (workspaceObject === null) {
console.log('workspaceObject is null or undefined')
return
}
console.log('workspaceObject', workspaceObject)
const thing = await statusBarPlugin.call('filePanel', 'getCurrentWorkspace')
console.log('thing', thing)
return thing
}
function getWorkspaceGitBranchName() {
async function getWorkspaceGitBranchName() {
if (!getGitBranchName()) return
getWorkspaceName()
let currentWorkspace: GetCurrentWorkspace = {} as GetCurrentWorkspace
currentWorkspace = await getWorkspaceName()
console.log('currentWorkspace', currentWorkspace)
setWorkspaceName(currentWorkspace?.name)
}
getWorkspaceGitBranchName()
return () => {
getWorkspaceGitBranchName()
}
}, [statusBarPlugin])
return (
<>

Loading…
Cancel
Save