Desktop support (#4484)

* Remove home link on desktop app

* Spellcheck, installation toasts, background styling, …

* Add email,slack, auth support

* More desktop style tweaks

* Move redirect to client

* cleanup

* Record desktop usage

* docs

* fix: Selection state in search input when double clicking header
This commit is contained in:
Tom Moor
2022-11-27 15:07:48 -08:00
committed by GitHub
parent ea9680c3d7
commit cc333637dd
38 changed files with 492 additions and 83 deletions

36
app/utils/Desktop.ts Normal file
View File

@@ -0,0 +1,36 @@
import { isMac, isWindows } from "./browser";
export default class Desktop {
/**
* Returns true if the client has inset/floating window controls.
*/
static hasInsetTitlebar() {
return this.isMacApp();
}
/**
* Returns true if the client is running in the macOS app.
*/
static isMacApp() {
return this.isElectron() && isMac();
}
/**
* Returns true if the client is running in the Windows app.
*/
static isWindowsApp() {
return this.isElectron() && isWindows();
}
/**
* Returns true if the client is running in a desktop app.
*/
static isElectron() {
return navigator?.userAgent?.includes("Electron");
}
/**
* The bridge provides secure access to API's in desktop wrapper.
*/
static bridge = window.DesktopBridge;
}