fix dm room name

This commit is contained in:
Peter Maquiran
2022-01-13 11:43:36 +01:00
parent ffcde98967
commit cf98e99531
4 changed files with 19 additions and 3 deletions
@@ -3,7 +3,7 @@ import { RoomService } from './room.service';
import { WsChatService } from 'src/app/services/chat/ws-chat.service'; import { WsChatService } from 'src/app/services/chat/ws-chat.service';
import { MessageService } from 'src/app/services/chat/message.service' import { MessageService } from 'src/app/services/chat/message.service'
import { SessionStore } from 'src/app/store/session.service'; import { SessionStore } from 'src/app/store/session.service';
import { capitalizeTxt } from 'src/plugin/text'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -101,7 +101,7 @@ export class WsChatMethodsService {
return name != SessionStore.user.RochetChatUser return name != SessionStore.user.RochetChatUser
})[0] })[0]
return roomName return capitalizeTxt(roomName.split('.')[0]) + ' ' + capitalizeTxt(roomName.split('.')[1])
} else { } else {
return roomData.fname return roomData.fname
} }
+9
View File
@@ -66,6 +66,15 @@
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script type="module" src="./assets/js/index.js"></script> <script type="module" src="./assets/js/index.js"></script>
<script>
Object.defineProperty(String.prototype, 'capitalize', {
value: function() {
return this.charAt(0).toUpperCase() + this.slice(1);
},
enumerable: false
});
</script>
</head> </head>
<body class='gov'> <body class='gov'>
+1 -1
View File
@@ -14,5 +14,5 @@ function deepFind(obj, path) {
} }
module.exports = { module.exports = {
deepFind: deepFind, deepFind: deepFind,
}; };
+7
View File
@@ -0,0 +1,7 @@
function capitalizeTxt(txt) {
return txt.charAt(0).toUpperCase() + txt.slice(1); //or if you want lowercase the rest txt.slice(1).toLowerCase();
}
module.exports = {
capitalizeTxt: capitalizeTxt
}