Skip to content

Commit

Permalink
fix reference to appid for v9
Browse files Browse the repository at this point in the history
  • Loading branch information
Connoropolous committed Oct 24, 2023
1 parent f06ffed commit c0a7045
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CellIdString, WithActionHash } from '../../types/shared'
import { ModalState, OpenModal } from '../../context/ModalContexts'
import { passphraseToUid } from '../../secrets'
import { PROJECT_APP_PREFIX } from '../../holochainConfig'
import { getAllApps } from '../../projectAppIds'

function ProjectDeleteButton({
onClick,
Expand Down Expand Up @@ -112,7 +113,12 @@ function EditProjectForm({
{/* Invite Members Button */}
<div
className="project-settings-button invite-members"
onClick={() => setModalState({ id: OpenModal.InviteMembers, passphrase: projectPassphrase })}
onClick={() =>
setModalState({
id: OpenModal.InviteMembers,
passphrase: projectPassphrase,
})
}
>
<Icon name="user-plus.svg" size="small" className="dark-grey" />
Invite Members
Expand Down Expand Up @@ -194,6 +200,10 @@ export default function ProjectSettingsModal({
memberCount,
}: ProjectSettingsModalProps) {
const [updatingProject, setUpdatingProject] = useState(false)
const [projectName, setProjectName] = useState('')
const [projectCoverUrl, setProjectCoverUrl] = useState('')
const [projectPassphrase, setProjectPassphrase] = useState('')
const [installedAppId, setInstalledAppId] = useState('')

const onSubmit = async () => {
setUpdatingProject(true)
Expand All @@ -218,12 +228,19 @@ export default function ProjectSettingsModal({
setProjectPassphrase(project.passphrase)
}
}, [project])
const [projectName, setProjectName] = useState('')
const [projectCoverUrl, setProjectCoverUrl] = useState('')
const [projectPassphrase, setProjectPassphrase] = useState('')

const uid = passphraseToUid(projectPassphrase)
const installedAppId = `${PROJECT_APP_PREFIX}-${uid}`
// const uid = passphraseToUid(projectPassphrase)
// const installedAppId = `${PROJECT_APP_PREFIX}-${uid}`
useEffect(() => {
getAllApps().then((apps) => {
const appForCell = Object.entries(apps).find(([appId, appInfo]) => {
return appInfo.cellIdString === cellIdString
})
if (appForCell) {
setInstalledAppId(appForCell[0])
}
})
}, [cellIdString])

return (
<Modal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
position: relative;
justify-content: space-between;
align-items: center;
overflow-y: hidden;

.validating-form-input {
margin-bottom: 28px;
Expand Down
2 changes: 1 addition & 1 deletion web/src/routes/App.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ const App: React.FC<AppProps> = ({
modalState,
setModalState,
setShowUpdateBar,
onProfileSubmit,
onProfileSubmit,
updateVersionInfo,
hasMigratedSharedProject,
uninstallProject,
Expand Down

0 comments on commit c0a7045

Please sign in to comment.