Skip to content

Commit

Permalink
Add warning if wallet not installed or activated
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Rey committed Feb 5, 2024
1 parent 46c4864 commit 7044569
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/massaStation/MassaStationDiscovery.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getRequest } from './RequestHandler';
import { PluginManagerBody } from './types';
import { PluginInfo, PluginManagerBody } from './types';

/**
* Url used for the MassaStation discovery and pinging the MassaStation server's index.html
Expand Down Expand Up @@ -32,16 +32,20 @@ export async function isMassaWalletPluginInstalled(): Promise<boolean> {
}

return !!response.result.find(
(module) =>
(module: PluginInfo) =>
module.name === MS_WALLET_PLUGIN_NAME &&
module.author === MS_WALLET_PLUGIN_AUTHOR,
module.status === 'UP',
module.author === MS_WALLET_PLUGIN_AUTHOR &&
module.status === 'UP',
);
}

export async function isMassaStationAndWalletPluginInstalled(): Promise<boolean> {
const isMassaStation = await isMassaStationInstalled();
const isMassaWalletPlugin = await isMassaWalletPluginInstalled();

if (!isMassaWalletPlugin) {
console.warn('Massa Wallet plugin is not installed or not activated');
}

return isMassaStation && isMassaWalletPlugin;
}

0 comments on commit 7044569

Please sign in to comment.