Commit ffa544b
authored
fix(lambda): [Getting Started] wrong template path after saving Debug Configs
## Problem
The issue occurs when working with two projects that have separate
`template.yaml` files in the workspace. When opening the Local Invoke
config for template1, and then selecting a resource from template2, the
template path changes to template2. After clicking the "Save Debug
Config" button, the template path changes back to template1 when
revisiting the config page.
This behavior is unexpected, as the template path should not change
after saving the debug configuration.
## Solution
The issue was caused by the way the Local Invoke page loads and updates
the resource fields. When the user opens the Local Invoke page, the
backend function `getResourceData` is called to populate the fields with
the initial resource data.
However, when the user selects a resource from a different template
(e.g., template2), the fields are updated accordingly. But when the user
returns to the Local Invoke page, the `getResourceData` function is
called again, and it populates the fields with the resource data from
the initial template (template1).
To address this, the solution is to add a check before running the
`getResourceData` function. If the fields are already populated, there's
no need to update them again with the initial resource data. This will
prevent the unexpected change in the template path after saving the
debug configuration.1 parent 4d4145c commit ffa544b
File tree
1 file changed
+16
-14
lines changed- packages/core/src/lambda/vue/configEditor
1 file changed
+16
-14
lines changedLines changed: 16 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
347 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
348 | 353 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
| 354 | + | |
| 355 | + | |
354 | 356 | | |
355 | 357 | | |
356 | 358 | | |
| |||
0 commit comments