feat: add color2 gradient color support and defer interactions for slow commands

This commit is contained in:
MythEclipse
2026-06-06 00:48:41 +07:00
parent 0dbd2b22c7
commit bf03af53af
9 changed files with 234 additions and 29 deletions
+2 -2
View File
@@ -39,13 +39,13 @@ class FakeRoleRepository implements RoleRepository {
return [...this.roles.values()];
}
async createRole(input: { name: string; color: string | null; permissions: string[]; position: number }) {
async createRole(input: { name: string; color: string | null; colors?: { primaryColor: string; secondaryColor?: string; tertiaryColor?: string } | null; permissions: string[]; position: number }) {
const id = `created-${this.roles.size + 1}`;
this.roles.set(id, { id, ...input });
return { id };
}
async updateRole(roleId: string, input: { name?: string; color?: string | null; icon?: string | null }) {
async updateRole(roleId: string, input: { name?: string; color?: string | null; colors?: { primaryColor: string; secondaryColor?: string; tertiaryColor?: string } | null; icon?: string | null }) {
const role = this.roles.get(roleId);
if (!role) throw new Error("Role does not exist");
this.roles.set(roleId, { ...role, ...input });