feat(plugins): install marketplace packages via dbx deep link
This commit is contained in:
18 files changed
+223
-1
No files matched your search
@@ -9,6 +9,7 @@ export function useTauriEvents(deps: {
|
||||
openDbFilePath: (path: string) => Promise<void>;
|
||||
openConnectionDeepLink: (url: string) => Promise<void>;
|
||||
openAiConfigDeepLink: (url: string) => Promise<void>;
|
||||
openPluginInstallDeepLink: (url: string) => Promise<void>;
|
||||
closeActiveSurface: () => void;
|
||||
}) {
|
||||
const connectionStore = useConnectionStore();
|
||||
@@ -153,6 +154,17 @@ export function useTauriEvents(deps: {
|
||||
}
|
||||
}).then((unlisten) => unlistenHandles.push(unlisten));
|
||||
|
||||
listen<string[]>("dbx-open-plugin-install-links", async (event) => {
|
||||
try {
|
||||
for (const url of event.payload) {
|
||||
await deps.openPluginInstallDeepLink(url);
|
||||
}
|
||||
focusCurrentWindow();
|
||||
} catch (e) {
|
||||
console.error("[DBX] dbx-open-plugin-install-links error:", e);
|
||||
}
|
||||
}).then((unlisten) => unlistenHandles.push(unlisten));
|
||||
|
||||
listen("dbx-close-active-tab", () => {
|
||||
deps.closeActiveSurface();
|
||||
}).then((unlisten) => unlistenHandles.push(unlisten));
|
||||
|
||||
Reference in new issue
Block a user