selecting conversation and expanding the window nicely

This commit is contained in:
talksik
2022-03-19 20:49:34 -04:00
parent 2a0f74435b
commit b656e9d3a9
6 changed files with 50 additions and 5 deletions
@@ -4,10 +4,22 @@
enum Channels {
ACTIVATE_LOG_IN = "ACTIVATE_LOG_IN",
AUTH_TOKENS = "AUTH_TOKENS",
RESIZE_WINDOW = "RESIZE_WINDOW",
}
export enum STORE_ITEMS {
AUTH_TOKENS = "AUTH_TOKENS",
}
export const Dimensions = {
default: {
height: 600,
width: 500,
},
selectedConvo: {
height: 600,
width: 900,
},
};
export default Channels;
+4 -1
View File
@@ -8,9 +8,12 @@ declare global {
initiateLogin(): void;
};
store: {
get(val: STORE_ITEMS): any;
get(val: STORE_ITEMS): Promise<any>;
set(property: STORE_ITEMS, val: any): void;
};
window: {
resizeWindow(newDimensions: { width: number; height: number }): void;
};
on(channel: Channels, func: any): void;
once(channel: Channels, func: any): void;
};
+6
View File
@@ -19,6 +19,12 @@ const electronAPI = {
// Other method you want to add like has(), reset(), etc.
},
window: {
resizeWindow(newDimensions: { width: number; height: number }) {
ipcRenderer.send(Channels.RESIZE_WINDOW, newDimensions);
},
},
on(channel: Channels, func: any) {
const validChannels = ["ipc-example"];
// if (validChannels.includes(channel)) {