Merge branch 'renderer_bug' into 'master'
[bug] fix renderer get message by id functinality See merge request crimata-ai/crimata-electron!13
This commit is contained in:
commit
1578ddf636
5 changed files with 30 additions and 28 deletions
|
|
@ -33,8 +33,8 @@ protocol.registerSchemesAsPrivileged([
|
|||
function createWindow() {
|
||||
// Create the browser window.
|
||||
win = new BrowserWindow({
|
||||
width: 450,
|
||||
height: 1025,
|
||||
width: 350,
|
||||
height: 525,
|
||||
resizable: true,
|
||||
webPreferences: {
|
||||
// Use pluginOptions.nodeIntegration, leave this alone
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
<g
|
||||
v-for="(item, index) in renderArr"
|
||||
:key="index"
|
||||
:id="index"
|
||||
class="messageList"
|
||||
transform="translate(0, 0)"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,6 @@
|
|||
import { Message } from "@/types/message/index";
|
||||
|
||||
const Messages: Message[] = [
|
||||
{
|
||||
content:
|
||||
"I can be there at 5 pm tomorrow to greet you at a Chick file with my almond and chive salad.",
|
||||
context: "You to Josie Wright",
|
||||
subContext: "josie@gmail.com",
|
||||
modifier: "sf",
|
||||
id: "1",
|
||||
time: ""
|
||||
},
|
||||
{
|
||||
content: "Sounds good, see you Thursday.",
|
||||
context: "Message from Josie Wright",
|
||||
|
|
@ -19,19 +10,12 @@ const Messages: Message[] = [
|
|||
time: ""
|
||||
},
|
||||
{
|
||||
content: "Hey Anna, did you get the paper done?",
|
||||
context: "Mesage from Tommy McConville",
|
||||
subContext: "New Conversation",
|
||||
modifier: "ai",
|
||||
id: "3",
|
||||
time: ""
|
||||
},
|
||||
{
|
||||
content: "Yes posting it online soon.",
|
||||
context: "You to Tommy McConville",
|
||||
subContext: "",
|
||||
modifier: "ai",
|
||||
id: "4",
|
||||
content:
|
||||
"I can be there at 5 pm tomorrow to greet you at a Chick file with my almond and chive salad.",
|
||||
context: "You to Josie Wright",
|
||||
subContext: "josie@gmail.com",
|
||||
modifier: "sf",
|
||||
id: "1",
|
||||
time: ""
|
||||
},
|
||||
{
|
||||
|
|
@ -50,6 +34,15 @@ const Messages: Message[] = [
|
|||
id: "6",
|
||||
time: ""
|
||||
},
|
||||
|
||||
{
|
||||
content: "Hey Anna, did you get the paper done?",
|
||||
context: "Mesage from Tommy McConville",
|
||||
subContext: "New Conversation",
|
||||
modifier: "ai",
|
||||
id: "3",
|
||||
time: ""
|
||||
},
|
||||
{
|
||||
content: "Hey do you know Enrique Hernandez?",
|
||||
context: "Message from Crimata",
|
||||
|
|
@ -58,6 +51,15 @@ const Messages: Message[] = [
|
|||
id: "7",
|
||||
time: ""
|
||||
},
|
||||
|
||||
{
|
||||
content: "Yes posting it online soon.",
|
||||
context: "You to Tommy McConville",
|
||||
subContext: "",
|
||||
modifier: "sf",
|
||||
id: "4",
|
||||
time: ""
|
||||
},
|
||||
{
|
||||
content: "Hey do you know Enrique Hernandez?",
|
||||
context: "Message from Crimata",
|
||||
|
|
|
|||
|
|
@ -31,10 +31,11 @@ export default function useMessageItemComp(m: string, id: string) {
|
|||
}
|
||||
}
|
||||
|
||||
const selfMessageMarginRight = 2.5;
|
||||
const calculateXoffset = async () => {
|
||||
switch (m) {
|
||||
case "sf":
|
||||
x.value = winW - messageWidth.value;
|
||||
x.value = winW - messageWidth.value - selfMessageMarginRight;
|
||||
break;
|
||||
default:
|
||||
x.value = paddingLeft;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import { ref } from "vue";
|
|||
export default function useOffsetCalculator() {
|
||||
const xOffset = ref(0);
|
||||
const yOffset = ref(0);
|
||||
const firstChildMarginTop = 40;
|
||||
let previousMessageHeight = 0;
|
||||
const messagePadding = 10;
|
||||
|
||||
|
||||
function setXoffset(message: HTMLElement): void {
|
||||
const computedQuery = window.getComputedStyle(message)
|
||||
const matrix = new WebKitCSSMatrix(computedQuery.webkitTransform);
|
||||
|
|
@ -14,7 +14,7 @@ export default function useOffsetCalculator() {
|
|||
|
||||
function setYoffset(messageHeight: number): void {
|
||||
if (previousMessageHeight === 0) {
|
||||
yOffset.value = 40;
|
||||
yOffset.value = firstChildMarginTop;
|
||||
} else {
|
||||
yOffset.value += previousMessageHeight + messagePadding;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue