Skip to content

Commit 0b9ae9b

Browse files
committed
Refactor profile image handling and update file path logic
- Updated the TalentForm component to set the profile image based on the provided data, ensuring a default image is used only when no valid image is available. - Simplified the file path handling in the AmbassadorDaoSingleApplicationPage to use relative paths instead of hardcoded URLs. - Cleaned up the JobApplicationModal to ensure file IDs are correctly managed without redundancy. - Fixed a potential issue in the ProjectSection component by adding optional chaining to prevent errors when checking project lengths. - Updated versioning information in versions.json for better dependency management.
1 parent 275bcd7 commit 0b9ae9b

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

app/(home)/ambassador-dao/onboard/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ const TalentForm = () => {
380380
// Set default profile image URL if no image is provided
381381
const submitData = {
382382
...data,
383-
profile_image: previewImage && previewImage.startsWith('data:image')
384-
? 'https://ava.com/profile.png'
385-
: data.profile_image || 'https://ava.com/profile.png',
383+
profile_image: data.profile_image && data.profile_image !== ''
384+
? data.profile_image
385+
: 'https://ava.com/profile.png',
386386
skill_ids: selectedSkills,
387387
social_links: validSocialLinks,
388388
years_of_experience: +data.years_of_experience,

app/(home)/ambassador-dao/sponsor/(sponsor)/listings/[id]/[application]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ const AmbasssadorDaoSingleApplicationPage = () => {
242242
</div>
243243
<p className='text-[var(--primary-text-color)] font-semibold cursor-pointer'>
244244
<a
245-
href={`https://s3.eu-west-2.amazonaws.com/ambassador-dao-public-assets/${file.path}`}
245+
href={`${file.path}`}
246246
target='_blank'
247247
rel='noopener noreferrer'
248248
>

components/ambassador-dao/jobs/JobApplicationModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ const JobApplicationModal: React.FC<JobApplicationModalProps> = ({
9999
const results = await Promise.all(uploadPromises);
100100

101101
const newFiles = [...files, ...selectedFiles];
102-
const newFileIds = [...fileIds, ...results.map((r) => r.file.id)];
103102

103+
const newFileIds = [...fileIds, ...results.map((r) => r.file.id)];
104104
setFiles(newFiles);
105105
setFileIds(newFileIds);
106106

components/ambassador-dao/profile/project-section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export default function ProjectSection() {
314314
(
315315
userProjects?.data?.opportunities ||
316316
userProjects?.data?.submissions
317-
).length === 0 && (
317+
)?.length === 0 && (
318318
<div className="flex flex-col items-center justify-center h-40 text-[var(--secondary-text-color)]">
319319
<Search size={48} className="mb-2 opacity-30" />
320320
<p>No projects found matching your filters</p>

toolbox/src/versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"avaplatform/avalanchego": "v1.13.4",
3-
"avaplatform/subnet-evm_avalanchego": "v0.7.9_v1.13.5",
4-
"avaplatform/icm-relayer": "v1.6.6"
3+
"avaplatform/subnet-evm_avalanchego": "v0.8.1-db-metrics-fix_v1.14.1-db-metrics-fix",
4+
"avaplatform/icm-relayer": "v1.7.3"
55
}

0 commit comments

Comments
 (0)