Skip to content

Commit

Permalink
Merge pull request #249 from rubickCenter/feat/v3.0.0
Browse files Browse the repository at this point in the history
🐛 尝试修复 arm build 问题
  • Loading branch information
muwoo authored Sep 27, 2023
2 parents 0cbbe35 + effd00f commit ad31382
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-2019, ubuntu-latest]
os: [macos-11, windows-2019, ubuntu-latest]

# create steps
steps:
Expand Down
4 changes: 2 additions & 2 deletions detach/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="handle">
<div class="devtool" @click="openDevTool" title="开发者工具"></div>
</div>
<div class="window-handle" v-if="platform !== 'darwin'">
<div class="window-handle" v-if="process.platform !== 'darwin'">
<div class="minimize" @click="minimize"></div>
<div class="maximize" @click="maximize"></div>
<div class="close" @click="close"></div>
Expand All @@ -30,7 +30,7 @@ import { ref } from 'vue';
const { ipcRenderer } = window.require('electron');
const platform = ref(window.process.platform);
const process = window.require('process');
const showInput = ref(false);
const storeInfo = localStorage.getItem('rubick-system-detach') || '{}';
Expand Down
4 changes: 3 additions & 1 deletion src/main/common/getSearchFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const getSearchFiles = (argv = process.argv, cwd = process.cwd()) => {
};

const putFileToRubick = (webContents, files) => {
webContents.executeJavaScript(`window.searchFocus(${JSON.stringify(files)})`);
webContents.executeJavaScript(
`window.searchFocus(${JSON.stringify(files)}, false)`
);
};

const copyFileOutsideOfElectronAsar = function (
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/plugins-manager/clipboardWatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { ref } from 'vue';

export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
const clipboardFile: any = ref([]);
const searchFocus = (files) => {
const searchFocus = (files, strict = true) => {
const config: any = localConfig.getConfig();
// 未开启自动粘贴
if (!config.perf.common.autoPast) return;
if (!config.perf.common.autoPast && strict) return;

if (currentPlugin.value.name) return;
const fileList = files || getCopyFiles();
Expand Down
8 changes: 8 additions & 0 deletions src/renderer/plugins-manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ const createPluginManager = (): any => {
state.pluginLoading = false;
};

window.searchFocus = (args, strict) => {
ipcRenderer.send('msg-trigger', {
type: 'removePlugin',
});
window.initRubick();
searchFocus(args, strict);
};

return {
...toRefs(state),
initPlugins,
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/plugins-manager/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ const optionsManager = ({
setOptionsRef,
});

window.searchFocus = searchFocus;

return {
options: optionsRef,
searchFocus,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/shims-vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ interface Window {
setCurrentPlugin: (plugin: any) => void;
pluginLoaded: () => void;
getMainInputInfo: () => any;
searchFocus: (args: any) => any;
searchFocus: (args: any, strict?: boolean) => any;
}

0 comments on commit ad31382

Please sign in to comment.