Commit 6b1f027
fix: add promise caching and error handling in loadNavermapsScript (#128)
* fix: add promise caching and error handling in loadNavermapsScript
- Implement promise caching to prevent duplicate script loading on concurrent calls
- Add null check for window.naver.maps with descriptive error message
- Reset cached promise on failure to allow retry
- Add .catch() in LoadNavermapsScript component to handle rejected promises
* fix: use URL-keyed Map for promise caching instead of single global variable
Different option sets (e.g., different client IDs or submodules) now each get their own cached promise instead of sharing a single global one.
---------
Co-authored-by: elroypedrokameo <infinitygramexray@gmail.com>
Co-authored-by: elroypedrokameo <elroypedrokameo@unnispick.com>1 parent e545f39 commit 6b1f027
1 file changed
Lines changed: 39 additions & 17 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
18 | 16 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
23 | 40 | | |
24 | | - | |
| 41 | + | |
| 42 | + | |
25 | 43 | | |
26 | 44 | | |
27 | 45 | | |
| |||
63 | 81 | | |
64 | 82 | | |
65 | 83 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
69 | 91 | | |
70 | 92 | | |
71 | 93 | | |
72 | | - | |
| 94 | + | |
73 | 95 | | |
74 | 96 | | |
0 commit comments