Various QoL fixes for Desktop App (#2999)
* Some ESLint fixes * Add login/logout signal to API, clear mentions on logout and flush cookies on login/logout * Fix issue where local and HTTP-only servers would not validate correctly * Reduce noise of renderer logging, adjust a few local renderer logs to be louder when needed * Fallback to beginning of hostname for servers that don't change the site name * Fix Save Image crash * Update the name for insecure servers too * Fix test * Fix lint * Reduce repetition
This commit is contained in:
@@ -26,6 +26,8 @@ export type DesktopAPI = {
|
||||
idleTime: number,
|
||||
isSystemEvent: boolean,
|
||||
) => void) => () => void;
|
||||
onLogin: () => void;
|
||||
onLogout: () => void;
|
||||
|
||||
// Unreads/mentions/notifications
|
||||
sendNotification: (title: string, body: string, channelId: string, teamId: string, url: string, silent: boolean, soundName: string) => Promise<{result: string; reason?: string; data?: string}>;
|
||||
|
2
api-types/lib/index.d.ts
vendored
2
api-types/lib/index.d.ts
vendored
@@ -20,6 +20,8 @@ export type DesktopAPI = {
|
||||
reactAppInitialized: () => void;
|
||||
setSessionExpired: (isExpired: boolean) => void;
|
||||
onUserActivityUpdate: (listener: (userIsActive: boolean, idleTime: number, isSystemEvent: boolean) => void) => () => void;
|
||||
onLogin: () => void;
|
||||
onLogout: () => void;
|
||||
sendNotification: (title: string, body: string, channelId: string, teamId: string, url: string, silent: boolean, soundName: string) => Promise<{
|
||||
result: string;
|
||||
reason?: string;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mattermost/desktop-api",
|
||||
"version": "5.8.0-3",
|
||||
"version": "5.8.0-4",
|
||||
"description": "Shared types for the Desktop App API provided to the Web App",
|
||||
"keywords": [
|
||||
"mattermost"
|
||||
@@ -28,6 +28,7 @@
|
||||
"scripts": {
|
||||
"build": "tsc --build --verbose",
|
||||
"run": "tsc --watch --preserveWatchOutput",
|
||||
"clean": "rm -rf tsconfig.tsbuildinfo ./lib"
|
||||
"clean": "rm -rf tsconfig.tsbuildinfo ./lib",
|
||||
"prepublish": "npm run build && rm -rf tsconfig.tsbuildinfo"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user