Skip to content

Commit

Permalink
Dash: Fix opening Dash action
Browse files Browse the repository at this point in the history
Changed the action to open Dash based on the way #202 is doing. This makes the documentation entry be opened right away, without the need to press `enter` after Dash launch – a quirk in the old action implementation.
  • Loading branch information
fturcheti committed Oct 24, 2021
1 parent 37f6a41 commit 625aa56
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions extensions/dash/src/DocsetSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { List, ActionPanel, ActionPanelItem, closeMainWindow } from "@raycast/api";
import { List, ActionPanel, ActionPanelItem, closeMainWindow, OpenAction } from "@raycast/api";
import { exec, execSync } from "child_process";
import { useState, useEffect } from "react";
import { getDashAppPath } from "./util/dashApp";
Expand Down Expand Up @@ -65,22 +65,15 @@ export default function DocsetSearch({ docset }: { docset: Docset }) {
searchBarPlaceholder={`Search in ${docset.docsetName}`}
onSearchTextChange={setSearchText}
>
{results.map((result) => (
{results.map((result, i) => (
<List.Item
key={result["@_uid"]}
title={result.title}
subtitle={result.subtitle[2]}
icon={result.icon}
actions={
<ActionPanel>
<ActionPanelItem
id="openDocSet"
title="Open in Dash"
onAction={() => {
execSync(`open dash://${docset.docsetKeyword}:"${result.title}"`);
closeMainWindow({ clearRootSearch: true });
}}
/>
<OpenAction title="Open in Dash" target={`dash-workflow-callback://${i}`} />
</ActionPanel>
}
/>
Expand Down

0 comments on commit 625aa56

Please sign in to comment.