mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 20:06:00 +00:00
main menu available in web version
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { openedTabs } from '../stores';
|
||||
import _ from 'lodash';
|
||||
import getElectron from './getElectron';
|
||||
|
||||
export class LoadingToken {
|
||||
isCanceled = false;
|
||||
@@ -38,3 +39,14 @@ export async function asyncFilter(arr, predicate) {
|
||||
|
||||
return arr.filter((_v, index) => results[index]);
|
||||
}
|
||||
|
||||
export async function shouldDrawTitleBar() {
|
||||
const electron = getElectron();
|
||||
if (!electron) {
|
||||
return false;
|
||||
}
|
||||
if (await electron.isNativeMenu()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
class ElectronApi {
|
||||
private ipcRenderer = getIpcRenderer();
|
||||
|
||||
constructor() {
|
||||
}
|
||||
constructor() {}
|
||||
|
||||
send(msg, args = null) {
|
||||
this.ipcRenderer.send(msg, args);
|
||||
@@ -28,7 +27,8 @@ class ElectronApi {
|
||||
}
|
||||
|
||||
async isNativeMenu() {
|
||||
await this.ipcRenderer.invoke('isNativeMenu');
|
||||
const res = await this.ipcRenderer.invoke('isNativeMenu');
|
||||
return res;
|
||||
}
|
||||
|
||||
async invoke(route, args) {
|
||||
|
||||
Reference in New Issue
Block a user