Don't save empty nicknames to nickname history if there's no previous entry
This commit is contained in:
parent
a3f697ad6e
commit
e684bf7dac
1 changed files with 1 additions and 0 deletions
|
@ -84,6 +84,7 @@ export class NameHistoryPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
if (!member) return;
|
||||
const latestEntry = await this.nicknameHistory.getLastEntry(member.id);
|
||||
if (!latestEntry || latestEntry.nickname !== member.nick) {
|
||||
if (!latestEntry && member.nick == null) return; // No need to save "no nickname" if there's no previous data
|
||||
await this.nicknameHistory.addEntry(member.id, member.nick);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue