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 type { SelfSignedCert } from "selfsigned";
|
||||
import { lensProxyCertificateChannel } from "../../common/certificate/lens-proxy-certificate-channel";
|
||||
import { lensProxyCertificateInjectionToken } from "../../common/certificate/lens-proxy-certificate-injection-token";
|
||||
import requestFromChannelInjectable from "../utils/channel/request-from-channel.injectable";
|
||||
|
||||
const lensProxyCertificateInjectable = getInjectable({
|
||||
id: "lens-proxy-certificate",
|
||||
instantiate: (di) => {
|
||||
const requestFromChannel = di.inject(requestFromChannelInjectable);
|
||||
|
||||
instantiate: () => {
|
||||
let certState: SelfSignedCert;
|
||||
const cert = {
|
||||
get: () => {
|
||||
@ -26,10 +22,6 @@ const lensProxyCertificateInjectable = getInjectable({
|
||||
certState = certificate;
|
||||
},
|
||||
};
|
||||
|
||||
requestFromChannel(lensProxyCertificateChannel).then((value) => {
|
||||
cert.set(value);
|
||||
});
|
||||
|
||||
return cert;
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user