Don't erase patterns on page load (#1383)

## Description:

Even if the player does not appear to have access to a pattern, do not
erase their setting.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors
This commit is contained in:
Scott Anderson
2025-07-09 00:20:38 -04:00
committed by GitHub
parent 739399b5a5
commit 78deecdb6c
2 changed files with 1 additions and 6 deletions
-5
View File
@@ -64,11 +64,6 @@ export class TerritoryPatternsModal extends LitElement {
async onUserMe(userMeResponse: UserMeResponse | null) {
this.patterns = await patterns(userMeResponse);
const p = this.patterns.find((p) => p.name === this.selectedPattern);
if (p === undefined || p.lockedReason || p.notShown) {
console.warn("selected pattern is locked or not shown, resetting");
this.selectPattern(undefined);
}
this.me = userMeResponse;
this.requestUpdate();
}
+1 -1
View File
@@ -184,7 +184,7 @@
<div class="container__row">
<flag-input class="w-[20%] md:w-[15%]"></flag-input>
<territory-patterns-modal class="w-[50%] md:w-[12%]">
<territory-patterns-modal class="w-[20%] md:w-[15%]">
<button
id="territory-patterns-input-preview-button"
class="w-full border p-[4px] rounded-lg flex cursor-pointer border-black/30 dark:border-gray-300/60 bg-white/70 dark:bg-[rgba(55,65,81,0.7)]"