mirror of
https://github.com/IvarK/AntimatterDimensionsSourceCode.git
synced 2024-11-10 06:02:13 +00:00
Prevent duplicate TS preset names
This commit is contained in:
parent
0d57c3728c
commit
0c7884b31a
@ -33,6 +33,10 @@ export default {
|
||||
nicknameBlur(event) {
|
||||
const newName = event.target.value.slice(0, 4).trim();
|
||||
if (!this.isASCII(newName)) return;
|
||||
|
||||
const existingNames = player.timestudy.presets.map(p => p.name);
|
||||
if (existingNames.includes(newName)) return;
|
||||
|
||||
this.preset.name = newName;
|
||||
this.name = this.preset.name;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user