mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-09 04:05:33 +08:00
🐛 修复 allDocs 问题,新增 shellShowItemInFolder API
This commit is contained in:
parent
497de040cf
commit
6adf25dbee
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rubick",
|
||||
"version": "2.0.1-beta.19",
|
||||
"version": "2.0.2",
|
||||
"author": "muwoo <2424880409@qq.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -141,4 +141,8 @@ window.rubick = {
|
||||
removePlugin() {
|
||||
ipcSend("removePlugin");
|
||||
},
|
||||
|
||||
shellShowItemInFolder: path => {
|
||||
ipcSend("shellShowItemInFolder", { path });
|
||||
},
|
||||
};
|
||||
|
@ -6,6 +6,7 @@ import {
|
||||
Notification,
|
||||
nativeImage,
|
||||
clipboard,
|
||||
shell,
|
||||
} from "electron";
|
||||
import { runner, detach } from "../browsers";
|
||||
import fs from "fs";
|
||||
@ -155,7 +156,7 @@ export const API: any = {
|
||||
return dbInstance.bulkDocs(API.DBKEY, data.docs);
|
||||
},
|
||||
dbAllDocs({ data }) {
|
||||
return dbInstance.bulkDocs(API.DBKEY, data.key);
|
||||
return dbInstance.allDocs(API.DBKEY, data.key);
|
||||
},
|
||||
getFeatures() {
|
||||
return API.currentPlugin.features;
|
||||
@ -239,13 +240,21 @@ export const API: any = {
|
||||
detachInputChange({ data }) {
|
||||
API.sendSubInputChangeEvent({ data });
|
||||
},
|
||||
|
||||
getLocalId() {
|
||||
return encodeURIComponent(app.getPath("home"));
|
||||
},
|
||||
|
||||
shellShowItemInFolder({ data }) {
|
||||
shell.showItemInFolder(data.path);
|
||||
return true;
|
||||
},
|
||||
};
|
||||
|
||||
export default (mainWindow: BrowserWindow) => {
|
||||
// 响应 preload.js 事件
|
||||
ipcMain.on("msg-trigger", async (event, arg) => {
|
||||
const window = arg.winId ? BrowserWindow.fromId(arg.winId) : mainWindow;
|
||||
|
||||
const data = await API[arg.type](arg, window, event);
|
||||
event.returnValue = data;
|
||||
// event.sender.send(`msg-back-${arg.type}`, data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user