Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed May 23, 2024
1 parent 8019ee1 commit a7cc1f5
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 18 deletions.
3 changes: 1 addition & 2 deletions frontend/components/Main/MainHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,14 @@ export const MainHeader = () => {
}).then(() => {
setServiceStatus(DeploymentStatus.DEPLOYED);
setIsBalancePollingPaused(false);
setServiceButtonState(ServiceButtonLoadingState.NotLoading);
setServiceButtonState(ServiceButtonLoadingState.NotLoading);
showNotification?.('Your agent is now running!');
});
} catch (error) {
setIsBalancePollingPaused(false);
setServiceButtonState(ServiceButtonLoadingState.NotLoading);
}
}, [
electronApi,
masterSafeAddress,
serviceTemplate,
setIsBalancePollingPaused,
Expand Down
11 changes: 6 additions & 5 deletions frontend/context/ElectronApiProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { ElectronStore, ElectronTrayIconStatus } from '@/types';
import { get } from 'lodash';
import { createContext, PropsWithChildren } from 'react';

export type ElectronApiContextProps = {
import { ElectronStore, ElectronTrayIconStatus } from '@/types';

type ElectronApiContextProps = {
closeApp?: () => void;
minimizeApp?: () => void;
setTrayIcon?: (status: ElectronTrayIconStatus) => void;
ipcRenderer?: {
send?: (channel: string, data: unknown) => void;
send?: (channel: string, data: unknown) => void; // send messages to main process
on?: (
channel: string,
func: (event: unknown, data: unknown) => void,
) => void;
invoke?: (channel: string, data: unknown) => Promise<unknown>;
) => void; // listen to messages from main process
invoke?: (channel: string, data: unknown) => Promise<unknown>; // send message to main process and get Promise response
};
store?: {
store?: () => Promise<ElectronStore>;
Expand Down
2 changes: 1 addition & 1 deletion frontend/context/StoreProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {

import type { ElectronStore } from '@/types';

import { ElectronApiContextProps } from './ElectronApiProvider';
import { ElectronApiContext } from './ElectronApiProvider';

export const StoreContext = createContext<{ storeState?: ElectronStore }>({
storeState: undefined,
Expand Down
4 changes: 4 additions & 0 deletions frontend/context/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
export * from './BalanceProvider';
export * from './ElectronApiProvider';
export * from './MasterSafeProvider';
export * from './PageStateProvider';
export * from './ServicesProvider';
export * from './SettingsProvider';
export * from './SetupProvider';
export * from './StoreProvider';
export * from './WalletProvider';
2 changes: 1 addition & 1 deletion frontend/hooks/useElectronApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useContext } from 'react';

import { ElectronApiContextProps } from '@/context/ElectronApiProvider';
import { ElectronApiContext } from '@/context/ElectronApiProvider';

export const useElectronApi = () => useContext(ElectronApiContext);
20 changes: 14 additions & 6 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1435,9 +1435,9 @@
"@types/react" "*"

"@types/react@*", "@types/react@^18.3.2":
version "18.3.2"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.2.tgz#462ae4904973bc212fa910424d901e3d137dbfcd"
integrity sha512-Btgg89dAnqD4vV7R3hlwOxgqobUQKgx3MmrQRi0yYbs/P0ym8XozIAlkqVilPqHQwXs4e9Tf63rrCgl58BcO4w==
version "18.3.3"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.3.tgz#9679020895318b0915d7a3ab004d92d33375c45f"
integrity sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==
dependencies:
"@types/prop-types" "*"
csstype "^3.0.2"
Expand Down Expand Up @@ -2554,9 +2554,9 @@ eastasianwidth@^0.2.0:
integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==

electron-to-chromium@^1.4.668:
version "1.4.778"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.778.tgz#1e429f3f9cf572936693a898c0527adf6123ef76"
integrity sha512-C6q/xcUJf/2yODRxAVCfIk4j3y3LMsD0ehiE2RQNV2cxc8XU62gR6vvYh3+etSUzlgTfil+qDHI1vubpdf0TOA==
version "1.4.780"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.780.tgz#8c6d7ff82b56b4219f2ae7918ee271ae25654f07"
integrity sha512-NPtACGFe7vunRYzvYqVRhQvsDrTevxpgDKxG/Vcbe0BTNOY+5+/2mOXSw2ls7ToNbE5Bf/+uQbjTxcmwMozpCw==

[email protected]:
version "6.5.4"
Expand Down Expand Up @@ -5267,6 +5267,14 @@ rc-virtual-list@^3.11.1, rc-virtual-list@^3.5.1, rc-virtual-list@^3.5.2:
rc-resize-observer "^1.0.0"
rc-util "^5.36.0"

[email protected]:
version "1.2.1"
resolved "https://registry.yarnpkg.com/react-canvas-confetti/-/react-canvas-confetti-1.2.1.tgz#22ac64cbc478cf57cb5f61c130322e359b35389d"
integrity sha512-onNjQNkhQjrB2JVCeRpJW7o8VlBNJvo3Eht9zlQlofNLVvvOd1+PzBLU5Ev8n5sFBkTbKJmIUVG0eZnkAl5cpg==
dependencies:
"@types/canvas-confetti" "1.4.0"
canvas-confetti "1.4.0"

react-dom@^18.3.1:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4"
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2420,9 +2420,9 @@ electron-updater@^6.1.8:
tiny-typed-emitter "^2.1.0"

electron@^30.0.6:
version "30.0.6"
resolved "https://registry.yarnpkg.com/electron/-/electron-30.0.6.tgz#9ddea5f68396ecca88ad7c2c466a30fc9c16144b"
integrity sha512-PkhEPFdpYcTzjAO3gMHZ+map7g2+xCrMDedo/L1i0ir2BRXvAB93IkTJX497U6Srb/09r2cFt+k20VPNVCdw3Q==
version "30.0.7"
resolved "https://registry.yarnpkg.com/electron/-/electron-30.0.7.tgz#305e1c2e79ca2cba34b9ced08f7efcd48487e09e"
integrity sha512-9ypQLaIvLj9W8o6fIiZpUabXJAW3a+K6vT78Vk9UJVImKVAoFIe1Umwd2FleyMqhnFBPF58Iawu/pSV0s+wRnA==
dependencies:
"@electron/get" "^2.0.0"
"@types/node" "^20.9.0"
Expand Down

0 comments on commit a7cc1f5

Please sign in to comment.