fix: correct type comparison errors
- jobUtils.ts: Remove string comparison for job.row (row is typed as number) - job.row === '1' comparison is always false, removed - grid.service.ts: Fix swap operation to compare position with position - Changed i.id === operation.targetPosition to i.position === operation.targetPosition - targetPosition is a number (position), not a string (id) Fixes "This comparison appears to be unintentional because the types have no overlap" errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
b7aa0bf27b
commit
b54ac91638
2 changed files with 3 additions and 3 deletions
|
|
@ -574,7 +574,7 @@ export class GridService {
|
||||||
|
|
||||||
case 'swap':
|
case 'swap':
|
||||||
const item1 = updated.find(i => i.id === operation.itemId)
|
const item1 = updated.find(i => i.id === operation.itemId)
|
||||||
const item2 = updated.find(i => i.id === operation.targetPosition)
|
const item2 = updated.find(i => i.position === operation.targetPosition)
|
||||||
if (item1 && item2) {
|
if (item1 && item2) {
|
||||||
const tempPos = item1.position
|
const tempPos = item1.position
|
||||||
item1.position = item2.position
|
item1.position = item2.position
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ export function jobSupportsAccessories(job: Job | undefined): boolean {
|
||||||
*/
|
*/
|
||||||
export function getJobSkillSlotCount(job: Job | undefined): number {
|
export function getJobSkillSlotCount(job: Job | undefined): number {
|
||||||
if (!job) return 0
|
if (!job) return 0
|
||||||
return job.row === 1 || job.row === '1' ? 3 : 4
|
return job.row === 1 ? 3 : 4
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -253,7 +253,7 @@ export function validateSkillConfiguration(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for Row 1 constraint
|
// Check for Row 1 constraint
|
||||||
if ((job.row === 1 || job.row === '1') && skills[3]) {
|
if (job.row === 1 && skills[3]) {
|
||||||
errors.push('Row I jobs only support 3 skill slots')
|
errors.push('Row I jobs only support 3 skill slots')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue