게임 연동 탭 Riot ID 칸: 고치는 중에 바뀐 이름은 고치기를 그만두면(입력을 되돌림) 반영 (useEffect 의존성 [server, dirty]) · v1.11.2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-11-21 07:53:55 +09:00
parent 977390078e
commit d2372283db
3 changed files with 6 additions and 5 deletions

View File

@@ -136,13 +136,14 @@ function RiotRow({ u }: { u: User }) {
.filter(Boolean);
const bad = ids.filter((s) => !RIOT_RE.test(s));
const dirty = ids.join(',') !== saved;
// 앱이 Riot ID 를 바꾸면(닉네임 · 태그를 바꾼 사람, v1.11.1) 입력칸도 새 값으로. 고치는 중인 칸은 그대로 둔다
// 앱이 Riot ID 를 바꾸면(닉네임 · 태그를 바꾼 사람, v1.11.1) 입력칸도 새 값으로. 고치는 중인 칸은 그대로 두고,
// 고치기를 그만두면(입력을 원래대로 되돌림) 그사이 바뀐 이름을 반영한다 (v1.11.2)
useEffect(() => {
if (server === saved || dirty) return;
setV(u.riot.map((r) => r.riotId).join(', '));
setSaved(server);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [server]);
}, [server, dirty]);
const savedCount = saved ? saved.split(',').length : 0;
const commit = async () => {
if (!dirty || bad.length) return;