fix key prop error

pull/4774/head
Joseph Izang 6 months ago
parent 1c49484177
commit 988014408e
  1. 2
      libs/remix-ui/statusbar/src/lib/components/scamDetails.tsx
  2. 42
      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) {
}
}, [])
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
useEffect(() => {
async function getGitBranchName() {
const gitRepo = await statusBarPlugin.call('fileManager', 'isGitRepo')
console.log('gitRepo', gitRepo)
return gitRepo
}
async function getWorkspaceName() {
const thing = await statusBarPlugin.call('filePanel', 'getCurrentWorkspace')
console.log('thing', thing)
return thing
}
async function getWorkspaceGitBranchName() {
if (!getGitBranchName()) return
let currentWorkspace: GetCurrentWorkspace = {} as GetCurrentWorkspace
currentWorkspace = await getWorkspaceName()
console.log('currentWorkspace', currentWorkspace)
setWorkspaceName(currentWorkspace?.name)
}
getWorkspaceGitBranchName()
return () => {
getWorkspaceGitBranchName()
}
console.log('workspaceObject', workspaceObject)
}
function getWorkspaceGitBranchName() {
if (!getGitBranchName()) return
getWorkspaceName()
}
getWorkspaceGitBranchName()
}, [statusBarPlugin])
return (
<>

Loading…
Cancel
Save