improve ui

This commit is contained in:
marlon-erler
2024-07-20 18:58:25 +02:00
parent ea18fb4aba
commit 11940231ca
7 changed files with 71 additions and 11 deletions
+5
View File
@@ -11,3 +11,8 @@ export function stringify(data: any): string {
export function parse(string: string): any {
return JSON.parse(string);
}
// sort
export function localeCompare(a: string, b: string): number {
return a.localeCompare(b);
}
+2 -1
View File
@@ -1,6 +1,7 @@
import StorageModel, { storageKeys } from "./storageModel";
import { ChatModel } from "./chatModel";
import { localeCompare } from "./Utility/utility";
import { v4 } from "uuid";
export default class ChatListModel {
@@ -40,7 +41,7 @@ export default class ChatListModel {
allChannels.push(chatModel.info.primaryChannel);
}
this.sortedPrimaryChannels = allChannels.sort((a, b) => a.localeCompare(b));
this.sortedPrimaryChannels = allChannels.sort(localeCompare);
};
// restore