mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
16 lines
477 B
TypeScript
16 lines
477 B
TypeScript
import { getInjectable } from "@ogre-tools/injectable";
|
|
import openSaveFileDialogInjectable from "../../../utils/save-file.injectable";
|
|
|
|
const downloadLogsInjectable = getInjectable({
|
|
id: "download-logs",
|
|
|
|
instantiate: (di) => {
|
|
const openSaveFileDialog = di.inject(openSaveFileDialogInjectable)
|
|
|
|
return (filename: string, logs: string[]) => {
|
|
openSaveFileDialog(filename, logs.join("\n"), "text/plain");
|
|
}
|
|
},
|
|
});
|
|
|
|
export default downloadLogsInjectable; |