Prevent duplicate TS preset names

This commit is contained in:
SpectralFlame 2023-06-29 23:01:00 -05:00 committed by cyip92
parent 0d57c3728c
commit 0c7884b31a

View File

@ -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;
},