Skip to content

Commit b466d5c

Browse files
committed
Merge branch 'main' of https://github.com/zulip/zulip-desktop into test
2 parents 8c17fd5 + a49cb77 commit b466d5c

36 files changed

+1098
-933
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
github: zulip
2+
patreon: zulip
3+
open_collective: zulip

app/common/typed-ipc.ts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import type {DNDSettings} from "./dnd-util";
2+
import type {MenuProps, NavItem, ServerConf} from "./types";
3+
4+
export interface MainMessage {
5+
"clear-app-settings": () => void;
6+
downloadFile: (url: string, downloadPath: string) => void;
7+
"error-reporting": () => void;
8+
"fetch-user-agent": () => string;
9+
"focus-app": () => void;
10+
"permission-callback": (permissionCallbackId: number, grant: boolean) => void;
11+
"quit-app": () => void;
12+
"realm-icon-changed": (serverURL: string, iconURL: string) => void;
13+
"realm-name-changed": (serverURL: string, realmName: string) => void;
14+
"reload-full-app": () => void;
15+
"save-last-tab": (index: number) => void;
16+
"set-spellcheck-langs": () => void;
17+
"switch-server-tab": (index: number) => void;
18+
"toggle-app": () => void;
19+
"toggle-badge-option": (newValue: boolean) => void;
20+
"toggle-menubar": (showMenubar: boolean) => void;
21+
toggleAutoLauncher: (AutoLaunchValue: boolean) => void;
22+
"unread-count": (unreadCount: number) => void;
23+
"update-badge": (messageCount: number) => void;
24+
"update-menu": (props: MenuProps) => void;
25+
"update-taskbar-icon": (data: string, text: string) => void;
26+
}
27+
28+
export interface MainCall {
29+
"get-server-settings": (domain: string) => ServerConf;
30+
"is-online": (url: string) => boolean;
31+
"save-server-icon": (iconURL: string) => string;
32+
}
33+
34+
export interface RendererMessage {
35+
back: () => void;
36+
"copy-zulip-url": () => void;
37+
destroytray: () => void;
38+
downloadFileCompleted: (filePath: string, fileName: string) => void;
39+
downloadFileFailed: (state: string) => void;
40+
"enter-fullscreen": () => void;
41+
"error-reporting-val": (errorReporting: boolean) => void;
42+
focus: () => void;
43+
"focus-webview-with-id": (webviewId: number) => void;
44+
forward: () => void;
45+
"hard-reload": () => void;
46+
"leave-fullscreen": () => void;
47+
"log-out": () => void;
48+
logout: () => void;
49+
"new-server": () => void;
50+
"open-about": () => void;
51+
"open-feedback-modal": () => void;
52+
"open-help": () => void;
53+
"open-network-settings": () => void;
54+
"open-org-tab": () => void;
55+
"open-settings": () => void;
56+
"permission-request": (
57+
options: {webContentsId: number | null; origin: string; permission: string},
58+
rendererCallbackId: number,
59+
) => void;
60+
"reload-current-viewer": () => void;
61+
"reload-proxy": (showAlert: boolean) => void;
62+
"reload-viewer": () => void;
63+
"render-taskbar-icon": (messageCount: number) => void;
64+
"set-active": () => void;
65+
"set-idle": () => void;
66+
"show-keyboard-shortcuts": () => void;
67+
"show-network-error": (index: number) => void;
68+
"show-notification-settings": () => void;
69+
"switch-server-tab": (index: number) => void;
70+
"switch-settings-nav": (navItem: NavItem) => void;
71+
"tab-devtools": () => void;
72+
"toggle-autohide-menubar": (
73+
autoHideMenubar: boolean,
74+
updateMenu: boolean,
75+
) => void;
76+
"toggle-dnd": (state: boolean, newSettings: DNDSettings) => void;
77+
"toggle-menubar-setting": (state: boolean) => void;
78+
"toggle-sidebar": (show: boolean) => void;
79+
"toggle-sidebar-setting": (state: boolean) => void;
80+
"toggle-silent": (state: boolean) => void;
81+
"toggle-tray": (state: boolean) => void;
82+
toggletray: () => void;
83+
tray: (arg: number) => void;
84+
"update-realm-icon": (serverURL: string, iconURL: string) => void;
85+
"update-realm-name": (serveRURL: string, realmName: string) => void;
86+
"webview-reload": () => void;
87+
zoomActualSize: () => void;
88+
zoomIn: () => void;
89+
zoomOut: () => void;
90+
}

app/common/types.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
export interface MenuProps {
2+
tabs: TabData[];
3+
activeTabIndex?: number;
4+
enableMenu?: boolean;
5+
}
6+
7+
export type NavItem =
8+
| "General"
9+
| "Network"
10+
| "AddServer"
11+
| "Organizations"
12+
| "Shortcuts";
13+
114
export interface ServerConf {
215
url: string;
316
alias: string;

app/main/badge-settings.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import electron, {app} from "electron";
22

33
import * as ConfigUtil from "../common/config-util";
44

5+
import {send} from "./typed-ipc-main";
6+
57
function showBadgeCount(
68
messageCount: number,
79
mainWindow: electron.BrowserWindow,
@@ -43,7 +45,7 @@ function updateOverlayIcon(
4345
if (messageCount === 0) {
4446
mainWindow.setOverlayIcon(null, "");
4547
} else {
46-
mainWindow.webContents.send("render-taskbar-icon", messageCount);
48+
send(mainWindow.webContents, "render-taskbar-icon", messageCount);
4749
}
4850
}
4951

0 commit comments

Comments
 (0)