dynamic initials
This commit is contained in:
parent
b7f3d6a858
commit
2b61fbac96
10 changed files with 153 additions and 109 deletions
|
|
@ -101,7 +101,6 @@ export default function useTextInputController(elementX: Ref) {
|
|||
|
||||
const onKeyDown = (e: KeyboardEvent) => {
|
||||
const key = keyboardNameMap[e.keyCode]
|
||||
console.log(key)
|
||||
|
||||
if (textInput) {
|
||||
|
||||
|
|
|
|||
|
|
@ -23,11 +23,9 @@
|
|||
|
||||
<script lang="ts">
|
||||
|
||||
import { defineComponent, ref, onMounted } from "vue";
|
||||
import { defineComponent, ref, onMounted, onUnmounted } from "vue";
|
||||
import draggify from "@/modules/draggify";
|
||||
|
||||
import { Profile } from "@/types/message/index";
|
||||
|
||||
import TextInput from "@/components/inputItem/textInput.vue";
|
||||
import useTextInputController from
|
||||
"@/components/inputItem/controllers/textCtrl";
|
||||
|
|
@ -42,7 +40,7 @@ export default defineComponent({
|
|||
setup() {
|
||||
|
||||
// Mark input item with user's initials.
|
||||
let initials = ref("")
|
||||
const initials = ref("")
|
||||
initials.value = "IN";
|
||||
|
||||
// Initial position.
|
||||
|
|
@ -60,19 +58,23 @@ export default defineComponent({
|
|||
const { recording } = useAudioInputController(typing)
|
||||
|
||||
// Update profile functionality.
|
||||
const onUpdateProfile = (_event: any, payload: Profile) => {
|
||||
window.localStorage.setItem("profile", JSON.stringify(payload));
|
||||
initials.value = payload.first[0] + payload.last[0]
|
||||
const onUpdateProfile = (_event: any, payload: any) => {
|
||||
initials.value = payload.message.first[0] + payload.message.last[0]
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.ipcRenderer.on("update-profile", onUpdateProfile);
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.ipcRenderer.removeAllListeners("update-profile");
|
||||
})
|
||||
|
||||
return {
|
||||
elementX,
|
||||
elementY,
|
||||
recording
|
||||
recording,
|
||||
initials
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue