mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
use runnables on renderer
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
0af39fad3d
commit
e8625b42e0
@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import { beforeFrameStartsFirstInjectionToken } from "../tokens";
|
||||||
|
import lensProxyCertificateInjectable from "../../certificate/lens-proxy-certificate.injectable";
|
||||||
|
import requestLensProxyCertificateInjectable from "../../certificate/request-lens-proxy-certificate.injectable";
|
||||||
|
|
||||||
|
const setupLensProxyCertificateInjectable = getInjectable({
|
||||||
|
id: "setup-lens-proxy-certificate",
|
||||||
|
instantiate: (di) => ({
|
||||||
|
id: "setup-lens-proxy-certificate",
|
||||||
|
run: async () => {
|
||||||
|
const requestLensProxyCertificate = di.inject(requestLensProxyCertificateInjectable);
|
||||||
|
const lensProxyCertificate = di.inject(lensProxyCertificateInjectable);
|
||||||
|
|
||||||
|
lensProxyCertificate.set(await requestLensProxyCertificate());
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
injectionToken: beforeFrameStartsFirstInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default setupLensProxyCertificateInjectable;
|
||||||
@ -4,15 +4,11 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import type { SelfSignedCert } from "selfsigned";
|
import type { SelfSignedCert } from "selfsigned";
|
||||||
import { lensProxyCertificateChannel } from "../../common/certificate/lens-proxy-certificate-channel";
|
|
||||||
import { lensProxyCertificateInjectionToken } from "../../common/certificate/lens-proxy-certificate-injection-token";
|
import { lensProxyCertificateInjectionToken } from "../../common/certificate/lens-proxy-certificate-injection-token";
|
||||||
import requestFromChannelInjectable from "../utils/channel/request-from-channel.injectable";
|
|
||||||
|
|
||||||
const lensProxyCertificateInjectable = getInjectable({
|
const lensProxyCertificateInjectable = getInjectable({
|
||||||
id: "lens-proxy-certificate",
|
id: "lens-proxy-certificate",
|
||||||
instantiate: (di) => {
|
instantiate: () => {
|
||||||
const requestFromChannel = di.inject(requestFromChannelInjectable);
|
|
||||||
|
|
||||||
let certState: SelfSignedCert;
|
let certState: SelfSignedCert;
|
||||||
const cert = {
|
const cert = {
|
||||||
get: () => {
|
get: () => {
|
||||||
@ -26,10 +22,6 @@ const lensProxyCertificateInjectable = getInjectable({
|
|||||||
certState = certificate;
|
certState = certificate;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
requestFromChannel(lensProxyCertificateChannel).then((value) => {
|
|
||||||
cert.set(value);
|
|
||||||
});
|
|
||||||
|
|
||||||
return cert;
|
return cert;
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user